Android: Fix Spinner and Item theme when using ActionBarSherlock

Well this was certainly an interesting side-effect of using themes. I had a little trouble getting the themes to look "right". It had to do with the way that the adapter was being created.

before before-items

Use the snippet below to fix the problem. It's the middle line's magic which solved the theming issue for me.

ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, list);

And there you have it, a nice default-style selection!


Copyright © Twig's Tech Tips
Theme by BloggerThemes & TopWPThemes Sponsored by iBlogtoBlog