I have two spinners, when I select first spinner, based on first spinner selection, second spinner arrays to get change.How to do that.
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="type">
<item>Select Type</item>
<item >Color</item>
<item >Weeks</item>
</string-array>
<string-array name="color">
<item>Blue</item>
<item >Orange</item>
<item >Red</item>
<item >Green</item>
</string-array>
<string-array name="weeks">
<item>Sunday</item>
<item >Monday</item>
<item >Tuesday</item>
<item >Wednesday</item>
</string-array>
</resources>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Select Type:"/>
<Spinner
android:id="@+id/spinner"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:prompt="@string/spinner_title"
android:drawSelectorOnTop = "true"/>
<Spinner
android:id="@+id/spinner1"
android:layout_width="match_parent"
android:prompt="@string/spinner_title1"
android:layout_height="wrap_content" />
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(
this, R.array.type, android.R.layout.simple_spinner_item);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinner.setAdapter(adapter);
In this two spinners, in first spinner, i have used "type", based on the selection of type of first spinner, how to change second spinner to use the array color and weeks?
Thanks in advance