title: Getting an ArrayList from Firestore and the document name
body: <p>I'm new on Google Firebase and I'm trying to learn something about it.
  I'm doing an Android app where you can create a group of person and set the title of the group..then, in the "group page", you can see all your group in a listview.
  The structure of my firestore db is something like this:</p>
  
  <p><strong>users</strong> --> <strong>email(document)</strong> ---> <strong>Group(collection)</strong> --> <strong>GroupName(Document)</strong> and the group name document contains the partecipants arrayList (partecipant 0 : Name1, partecipant1: name2 etc).</p>
  
  <p>I would like to retrieve the document id(which is the group title) and the arrayList of partecipants, but I don't know of to use the for each in the code...</p>
  
  <p>This is my code:</p>
  
  <pre><code>public void load_list_view(){
  
      String email = getEmail();
      final DocumentReference docRef = db.collection("users").document(email).collection("Group").document();
  
      docRef.get()
              .addOnSuccessListener(new OnSuccessListener&lt;DocumentSnapshot&gt;() {
                  @Override
                  public void onSuccess(DocumentSnapshot documentSnapshot) {
  
  
                          titleArray.add(documentSnapshot.getId());
                          titleString = documentSnapshot.getId();
  
                          partecipantsArray.add(documentSnapshot.getString("partecipant"));
                          num_partecipants =  partecipantsArray.size();
                          numArray.add(num_partecipants);
                          trash = R.drawable.trash_icon;
                          firstChar = Character.toString(titleString.charAt(0));
                          firstCharArray.add(firstChar);
                          customAdapter = new GroupAdapter(GroupActivity.this, firstCharArray, titleArray, numArray, trash);
                          listView.setAdapter(customAdapter);
  
  
                  }
              })
              .addOnFailureListener(new OnFailureListener() {
                  @Override
                  public void onFailure(@NonNull Exception e) {
                      Toast.makeText(GroupActivity.this, e.getStackTrace().toString(), Toast.LENGTH_LONG).show();
  
                  }
              });
  
  }
  </code></pre>
  
  <p>with <code>titleArray.add(documentSnapshot.getId());</code> it retrieve a random ID and I can't understand why.</p>
  
  <p>I haven't found enough documentation on Internet about <code>Arraylist</code> and firestore.</p>