Friday, January 4, 2013

Spinner being different ICS and later - a fix

We are using the Android Spinner control with an ArrayAdapter. On my 2.2 phone everything was great. I tap the Spinner and I get a list of items with text to the left and a radio button on the right. But on Ice Cream Sandwich and above the radio button did not appear.

I was using:

logAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);

Changed to:
logAdapter.setDropDownViewResource(android.R.layout.simple_list_item_single_choice);

Now I have the same look on older and newer versions of the Android SDK. I want the radio button to appear showing the last selected item in the list always.

No comments:

Post a Comment