title: Wait until Firestore data is retrieved to launch an activity
body: <p>I've made a List of POJO Objects that get values from my Cloud Firestore database. This List is itself a Class having in mind to retrieve attributes everytime I create a new List. The thing is that the List is not filled in the on create activity but time after. I've tried adding loops, tasks, waits, but not getting the result desired. Here is how I retrieve my data satisfactorally:</p>
  
  <pre><code>private void retrieveData(){
          reference = firestore.collection("attractions");
          reference.addSnapshotListener(new EventListener&lt;QuerySnapshot&gt;() {
              @Override
              public void onEvent(@Nullable QuerySnapshot queryDocumentSnapshots,
                                  @Nullable FirebaseFirestoreException e) {
                  attractionList.clear();
                  for (DocumentSnapshot snapshot : queryDocumentSnapshots) {
                      Attraction attraction = snapshot.toObject(Attraction.class);
                      addAttractions(attraction);
                  }
              }
          });
      }
  </code></pre>
  
  <p>I retrieve the data everytime I create a new Object:</p>
  
  <pre><code>public AttractionList() {
          firestore.setFirestoreSettings(settings);
          reference = firestore.collection("attractions");
          attractionList = new ArrayList&lt;&gt;();
          retrieveData();
      }
  </code></pre>
  
  <p>Then, if I check the List size on my Activity on create:</p>
  
  <pre><code>@Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_attraction);
          Toolbar toolbar = findViewById(R.id.tb_attraction);
          setSupportActionBar(toolbar);
  
          //Creating POJO List and retrieving data
          attractionList = new AttractionList();
          Log.e("List Size: ", ""+attractionList.getAttractionList().size());
          //List Size: 0
      }
  </code></pre>
  
  <p>But if I use the same Log time after, in any button:</p>
  
  <pre><code>@Override
      public void onBackPressed(){
          Log.e("List Size: ", ""+attractionList.getAttractionList().size());
          //List Size: 16
      }
  </code></pre>
  
  <p>I don't really want to retrieve data in every single Activity or creating intents to bring the Object between Activities. There is any way I could fix this? </p>
  
  <p>PS: This is my first post. Sorry If I've haven't done it on the right way. Thank's a lot.</p>