问题
I have some dependencies between my spinners and it happens, that a spinner becomes empty.
The problem now is, that I don't know how to clear the spinner, I'm adopting the data of the adapter, notify the adapter and if I click the spinner, there are no values in there, but the spinner's selected item is NOT cleared and still is displayed...
回答1:
I'm not sure what you want, but to delete all itens in your spinner you can set the adapter null, like this:
mySpinner.setAdapter(null);
and if you want to remove a specific item, then you should remove it from your adapter and set your spinner again
mySpinner.setAdapter(myAdapter);
来源:https://stackoverflow.com/questions/16901271/android-spinner-how-do-i-remove-the-current-selection