Rohhit
Rohhit

Reputation: 742

changing 2nd spinner values on changing 1st spinner value

I am learning android spinners.

I have two spinners in my app.

I want to change Item value of second spinner on changing(Or selecting) item value of first spinner.

How I can do this ?

Can any one provide any sample code or link, which will help me ?

And Sorry if, I am repeating the question again.

Upvotes: 1

Views: 659

Answers (1)

Marcel Blanck
Marcel Blanck

Reputation: 866

Yes here is the link, the holy android docs http://developer.android.com/guide/topics/ui/controls/spinner.html

You need to implement an OnItemSelectedListener and set it on the first spinner as shown in the docs.

Then you call setSelection on the other Spinner in the onItemSelected callback.

Upvotes: 1

Related Questions