Advertisement
Guest User

Untitled

a guest
Nov 17th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.86 KB | None | 0 0
  1. package moon.telesto.compass;
  2.  
  3. import android.util.Log;
  4.  
  5. import com.google.firebase.firestore.QueryDocumentSnapshot;
  6.  
  7. import java.util.ArrayList;
  8. import java.util.HashMap;
  9.  
  10. private FirebaseFirestore mFirestore;
  11. List<Map<String, Object>> packs = new ArrayList<>();
  12.  
  13. public class Fire {
  14.     public ArrayList requestFireStoreDocuments() {
  15.         mFirestore
  16.             .collection("spaeties")
  17.             .get()
  18.             .addOnCompleteListener(task -> {
  19.                 if (task.isSuccessful()) {
  20.                     for (QueryDocumentSnapshot document : task.getResult()) {
  21.                         packs.add(new HashMap<>(document.getData()));
  22.                     }
  23.  
  24.                     return packs;
  25.                 } else {
  26.                     Log.d(YOY, "Error getting documents: ", task.getException());
  27.                 }
  28.             });
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement