Reputation: 1
I'm creating a flight app. I have 2 spinners: spinOrigin
and spinDestination
;
I also have m_array
for the items I want to put on the spinners: "Place1
","Place2
", and "Place3
".
What I want to achieve is if I chose "Place1
" from spinner spinOrigin
, "Place1
" should be deleted so that only "Place2
" and "Place3
" will be left to choose from from spinner spinDestination
.
Upvotes: 0
Views: 2484
Reputation: 10014
ArrayAdapter<String>
notifyDataSetChanged()
on your adapter, it will update the spinner automatically.Upvotes: 1
Reputation: 16191
Simply remove that element from your ArrayAdapter<String>
that you apply to your Spinner
and apply that adapter again to your Spinner
to refresh it.
Upvotes: 0