Wednesday, January 28, 2015

Spinner text not showing

   The spinner view was working great on newer Android versions . I decided to try on version 2.2, so I started up an emulator running 2.2 and that's when I noticed the trouble. The text in the spinner list was not showing up unless you clicked on it. The actions worked correctly and on other Android versions the text showed. So I tried setting color of text and background but that only effected the spinner and not the drop down list itself. The fix was changing the line:
adapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);

To:
adapter.setDropDownViewResource(android.R.layout.simple_expandable_list_item_1);

I'm still not sure why the first one did not work.

10,000 hour to Mastery.
10,000 - 631 = 9369 hours left