title: get all data (documents) inside subcollection of main collection firestore
body: <p>I have sub collection called "student" which inside collection "class", i need to get all documents under many subcollection (iteration) "student" and need to execute some method after all query end. How to execute some method after querying sub-collection finished. please help me, Thanks in advance.</p>
  
  <p>please consider database structure here i loop throw various collection and find out all students details. </p>
  
  <p><a href="https://i.stack.imgur.com/hTFxR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hTFxR.png" alt="enter image description here"></a> 
  <strong>How to find find out</strong>
  <br>1) <em>all students mark list of organisation</em>. 
  <br>2) <em>all students mark list of department</em>. 
  <br>3) <em>all students mark list of class</em>. </p>
  
  <pre><code>   classCollectionReference.get().addOnCompleteListener(
          new OnCompleteListener&lt;QuerySnapshot&gt;() {
              @Override
              public void onComplete(@NonNull Task&lt;QuerySnapshot&gt; task) {
                  if (task.isSuccessful()) {
                      for (DocumentSnapshot snapshot : task.getResult()) {
                          studentCollectionReference = classCollectionReference.document(snapshot.getId()).collection("student");
                          studentCollectionReference .get().addOnCompleteListener(new OnCompleteListener&lt;QuerySnapshot&gt;() {
                              @Override
                              public void onComplete(@NonNull Task&lt;QuerySnapshot&gt; task) {
                                  if (task.isSuccessful()) {
                                      addListItem(task);
                                     //I need to call this method only after added all subcollection item to the list     
                                     showAllListData();
                                  }
                              }
                          });
  
                      }
                  }
              }
          }
      );
  </code></pre>