I have placed 4 spinners in a SlidingDrawer
. And I have created a string-array in string.xml, like
<string-array name="colorArray">
<item>Red</item>
<item>Green</item>
<item>Blue</item>
<item>Orange</item>
<item>While</item>
<item>Black</item>
</string-array>
I want to populate the spinners with this array..
For that i had done like,
option1 = (Spinner)findViewById(R.id.spinner_first);
adapter = ArrayAdapter.createFromResource(getApplicationContext(),
R.array.colorArray, android.R.layout.simple_spinner_item);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
option1.setAdapter(adapter);
and the same for the other 3. It works fine for me now. Now the result is like, the entire array is listed on all the spinners.
But i want to remove the item selected by one spinner in all the other spinners, so that that item is not shown in the other 3.. For example, if i select "red" for the first spinner, the item "Red" must be removed from all other spinners..
How can that be achieved.
Sample codes and guidance will be appreciable.. Thanks in advance..