title: Get an ArrayList from Firestore and select 3 random Strings from that list
body: <p>I successfully managed to get the strings that are stored in the array of the database (<code>Log.d("TAG", entry.getValue().toString());</code>shows the values of the strings of the array). </p>
  
  <p>The strings are auto-generated document ids stored in an Array in Firestore, so the goal is getting 3 ids so I can make 3 queries to get the actual documents.</p>
  
  <p>I am now stuck on how to attach the strings I got from Firestore to an ArrayList and then get 3 individual random strings from it.</p>
  
  <p>I am relatively new to ArrayLists so any help is much appreciated!</p>
  
  <p>Here is my code:</p>
  
  <pre><code>questionRef.document(tvCat1).get().addOnCompleteListener(new OnCompleteListener&lt;DocumentSnapshot&gt;() {
      @Override
      public void onComplete(@NonNull Task&lt;DocumentSnapshot&gt; task) {
          if (task.isSuccessful()) {
  
              DocumentSnapshot document = task.getResult();
  
              Map&lt;String, Object&gt; map = document.getData();
              for (Map.Entry&lt;String, Object&gt; entry : map.entrySet()) {
                  if (entry.getKey().equals("questions")) {
                      Log.d("TAG", entry.getValue().toString());
  
  // Create function that gets 3 different values from the ArrayList and store them in 3 different Strings
  
                  }
              }
          }
      }
  });
  
  </code></pre>
  
  <p>Here is how I structured the database. Currently I am getting the ArrayList so I don't have so much reads. On the right you can see the documents I want to query when I have selected 3 random document ids from the ArrayList:</p>
  
  <p><a href="https://i.stack.imgur.com/ffAfA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ffAfA.png" alt="enter image description here"></a></p>