We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I tried but I can't show the spinner selected item in the list.
The text was updated successfully, but these errors were encountered:
It's because the setup of the spinner needs to be done inside a successful or completed task for example :-
collectionRef.get().addOnCompleteListener(task -> { if (task.isSuccessful()) { for (QueryDocumentSnapshot document : task.getResult()) { //Log.d(TAG, document.getId() + " => " + document.getData().get("myField")); // replace 'myField' with your field name categories.add((String) document.getData().get("name")); } //Spinner setup inside the successful task ArrayAdapter<CharSequence> adapter = new ArrayAdapter<CharSequence>(this, android.R.layout.simple_spinner_item, categories); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); //mySpinner.setSelection(0); mySpinner.setAdapter(adapter); } else { Log.d(TAG, "Error getting documents: ", task.getException()); } });
Sorry, something went wrong.
No branches or pull requests
I tried but I can't show the spinner selected item in the list.
The text was updated successfully, but these errors were encountered: