Question

I am working on an Android application where I want a user to select a RadioButton corresponding to one category, and add a spinner within the same layout, where the displayed spinner depends on the radio button that was selected. This means for each RadioButton I have a different spinner. I know how to add view to the layout but I was wondering how I might go about storing each of the individual spinners and requesting them when the corresponding category is selected. Is it possible to store them within a layout activity and select the correct one using findViewById?

Was it helpful?

Solution

Agree to Trushit

add all the spinners in the view & on performing the Radio Button event set the visibility of the spinners.

yourSpinner.setVisibility(View.VISIBLE);

&

yourSpinner.setVisibility(View.GONE);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top