title: How to download an array from firestore. Java
body: <pre><code>private void downloadArray(){
      final DocumentReference docRef = database.collection("Users").document(uid);
      docRef.get().addOnCompleteListener(new OnCompleteListener&lt;DocumentSnapshot&gt;() {
          @Override
          public void onComplete(@NonNull Task&lt;DocumentSnapshot&gt; task) {
              if(task.isSuccessful()){
                  DocumentSnapshot documentSnapshot = task.getResult();
                  ArrayList&lt;String&gt; ArrayFromFirestore= (ArrayList&lt;String&gt;) documentSnapshot.get("categories");
                  CopyArray.addAll(ArrayFromFirestore);
              }
          }
  
      });
  }
  </code></pre>
  
  <p>CopyArray is private class variable. I try to copy one array into another, and despite the fact my ArrayFromFirestore have got elements inside, CopyArray always has 0
  Can I modify variables from outside of this function?</p>