Untitled

mail@pastecode.io avatar
unknown
plain_text
3 years ago
734 B
8
Indexable
Never
List<String> doc_Category = new ArrayList<String>();
doc_Category.add("Select Category");

fStore.collection("doc_category")
        .get()
        .addOnCompleteListener(new OnCompleteListener<QuerySnapshot>() {
            @Override
            public void onComplete(@NonNull Task<QuerySnapshot> task) {
                if (task.isSuccessful()) {
                    int i = 0;
                    for (QueryDocumentSnapshot document : task.getResult()) {
                        doc_Category.add(document.getString("name").toString());
                    }
                } else {
                    Log.d("DocCat", "Error getting documents: ", task.getException());
                }
            }
        });