Hello Coders!
I have a spinner with list of elements in an arrays asin
- spinner.ItemSelected += new EventHandler
(spinner_ItemSelected); - var adapter = ArrayAdapter.CreateFromResource(
- view.Context, Resource.Array.planets_array, Android.Resource.Layout.SimpleSpinnerItem);
- adapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
- spinner.Adapter = adapter;
- private void spinner_ItemSelected(object sender, AdapterView.ItemSelectedEventArgs e)
- {
- int resourceID = 1;
- switch (e.Position)//position is the array index
- {
- case 1: //Brakes
- resourceID = Resource.Array.plane_array;
- break;
- case 2: //Check engine and warning lights
- resourceID = Resource.Array.plan_array;
- break;
- case 3: //electricals
- resourceID = Resource.Array.elec_array;
- break;
- case 4: //engine and peformance
- resourceID = Resource.Array.plana_array;
- break;
- case 5: //Heating and air-conditioning
- resourceID = Resource.Array.planc_array;
- break;
- case 6: //lights
- resourceID = Resource.Array.light_array;
- break;
- case 7: //steering and handling
- resourceID = Resource.Array.hand_array;
- break;
- case 8: //Tires and wheel
- resourceID = Resource.Array.tire_array;
- break;
- case 9: //Transmission
- resourceID = Resource.Array.trans_array;
- break;
- }
- if (resourceID > 1)
- {
- var adapter = ArrayAdapter.CreateFromResource(
- e.View.Context, resourceID, Android.Resource.Layout.SimpleSpinnerItem);
- adapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
- spinner1.Adapter = adapter;
- }
- else
- spinner1.Adapter = null;
- }
Now, the idea is that on the second spinner, when an attribute is being clicked, lets say "Brake is Worn Out"
i want to populate a Textview in another fragment to show a result on ButtonClick.
please how do i set the spinner2 to know what is clicked and how to Populate the textview
please Somebody/Anybody should help me out

Qing RyderPosted May 30, 2018, 9:52 AM
on the first,
Suppose i have 2 spinners,
the first spinner has elements of country, when a user clicks on his country, the second spinner will populate states in that selected country.
and on the second spinner, when a user clicks on a the state, it should pass "Your state is (Selected state)" to a textview on another fragment.
i hope this explains what am trying to get.
but my problem is the bolded text
Thank you