Spinner Not Working Well With Firestore's Document.getid
Any idea why this doesn't work? mFirestore.collection('DR1') .document(UserID) .collection('Story') .get() .addOnCompleteListener(ne
Solution 1:
This is happening because you are not defining your spinnerArray
inside the onComplete()
method, which has an asynchronous behaviour. To solve this, move the declaration of your spinnerArray
inside the onComplete()
method. To display your records you also need to set the adapter inside the method. For more information please see my answer from this post. I also recommend that you see this video, Asynchronous Firebase API - Cloud Firestore and Android, for a better understanding.
Post a Comment for "Spinner Not Working Well With Firestore's Document.getid"