Untitled

 avatar
unknown
plain_text
4 years ago
734 B
10
Indexable
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());
                }
            }
        });
Editor is loading...