Any idea why this doesn't work?
mFirestore.collection("DR1")
.document(UserID)
.collection("Story")
.get()
.addOnCompleteListener(new OnCompleteListener<QuerySnapshot>() {
@Override
public void onComplete(@NonNull Task<QuerySnapshot> task) {
if (task.isSuccessful()) {
for (DocumentSnapshot document : task.getResult()) {
spinnerArray.add(String.valueOf(document.getId()));
}
} else {
Log.d(TAG, "Error getting documents: ", task.getException());
}
}
});
The spinner drop down works (with no default selection, just empty), but on selection, it also does not appear. No error whatsoever. I have setOnItemSelectedListener
to Toast.maketext
on a selection, but nothing appears as well.
But once I add a:
spinnerArray.add("test");
Before the Firestore database call (the for-loop), then everything works fine. (default selection on "test" on the dropdown list, and when I select another entry, Toast.maketext
appears, and selection appears on the spinner)
Thanks again.