I have a question about spinners, and cannot find anything online about how to do it.
I have a spinner in my app, with region selections i.e. Southwest, Southeast.
I want the spinner to selections available of the second spinner to be dependent on the selection made in the first one. i.e. When the user selects Southwest the choices on the second spinner would be Lake Charles, Iowa, Lake Arthur etc. And when the user selects southeast, the choices of the second spinner would be Gretna, New Orleans, Luling etc.
how do I go about doing that?
examples would be greatly appreciated!
Thank you!
Well essentially you would catch the first spinners selection event. Upon this you would change the contents of the list availabe for the second spinner. You might also have to call invalidateView() in order for the change to take effect. So there are really three parts
1) Catch the selection in a onClick handler.
2) modify the data for the second spinner, and reset spinner2 data to the adjusted data after filtering.
3) Invalidate the second spinner if needed, and possibly invalidateView on the containingView so it all shows up.
So break it down to these three steps and let us know if you have questions about any of them.
Try this Code..
I hope it will helpful to you...