title: How to get an array from Firestore?
body: <p>I have the data structure illustrated below stored in Cloud Firestore. I want to save the <code>dungeon_group</code> which is an array of strings stored in Firestore.</p>
  <p>I have difficulty in getting the data and stored as an array. I am just able to get a weird string but any method to store as a string array? Below is the code I used.</p>
  <p>I am able to achieve this in Swift as follow, but not sure how to do the same in Android.</p>
  <p><a href="https://i.stack.imgur.com/P6DbL.png" rel="noreferrer"><img src="https://i.stack.imgur.com/P6DbL.png" alt="enter image description here" /></a></p>
  <p>Swift:</p>
  <pre><code>Firestore.firestore().collection(&quot;dungeon&quot;).document(&quot;room_en&quot;).getDocument { 
      (document, error) in
      if let document = document {
          let group_array = document[&quot;dungeon_group&quot;] as? Array ?? [&quot;&quot;]
          print(group_array)
      }    
  }
  </code></pre>
  <p>Java Android:</p>
  <pre><code>FirebaseFirestore.getInstance().collection(&quot;dungeon&quot;)
                   .document(&quot;room_en&quot;).get()
                   .addOnCompleteListener(new 
                       OnCompleteListener&lt;DocumentSnapshot&gt;() {
                       @Override
                       public void onComplete(@NonNull Task&lt;DocumentSnapshot&gt; task) {
                           DocumentSnapshot document = task.getResult();
                           String group_string= document.getData().toString();
                           String[] group_array = ????
                           Log.d(&quot;myTag&quot;, group_string);
                       }
                   });
  </code></pre>
  <p>Console output as the follow:</p>
  <blockquote>
  <p>{dungeon_group=[3P, Urgent, Mission Challenge, Descended,
  Collaboration, Daily, Technical, Normal]}</p>
  </blockquote>