title: Why does my code do the OnComplete first and the OnSucces later even when OnComplete is above in the code?
body: <p>Using OnComplete I want to retrieve my documentid.
  I need this docid inside the OnSucces. So it has to go in that order. Why hadn't it?</p>
  <p><strong>LesAdapter.java, with the documentID hardcoded to get good LOGS</strong></p>
  <pre><code> fStore.collection(&quot;Lessen&quot;).whereEqualTo(&quot;Wanneer&quot;, model.getWanneer())
                  .get()
                  .addOnCompleteListener(new OnCompleteListener&lt;QuerySnapshot&gt;() {
                                             @Override
                                             public void onComplete(@NonNull @NotNull Task&lt;QuerySnapshot&gt; task) {
                                                 if (task.isSuccessful()) {
                                                     for (QueryDocumentSnapshot document : Objects.requireNonNull(task.getResult())) {
                                                         docid = document.getId();
                                                         Log.d(TAG, &quot;onComplete: docid =  &quot; + docid);
                                                     }
                                                 }
                                             }
                                         });
      fStore
              .collection(&quot;Lessen&quot;).document(&quot;IYedtghMuNI9fmrlJjX2&quot;).
              collection(&quot;Deelnemers&quot;).document(userID)
              .get()
              .addOnSuccessListener(new OnSuccessListener&lt;DocumentSnapshot&gt;() {
                                        @Override
                                        public void onSuccess(DocumentSnapshot documentSnapshot) {
                                            Log.d(TAG, &quot;onSuccess: lid ingeschreven?&quot;);
                                        }
                                    })
              .addOnFailureListener(new OnFailureListener() {
                  @Override
                  public void onFailure(@NonNull @NotNull Exception e) {
                      Log.d(TAG, &quot;onFailure: lid niet ingeschreven?&quot;);
                  }
              });
  </code></pre>
  <p>LOGS:
  <a href="https://i.stack.imgur.com/RbdeT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RbdeT.png" alt="enter image description here" /></a></p>