I found out that when using android:entries with a ListView it uses android.R.layout.simple_list_item_1 as the layout for the list item and android.R.id.text1 as the TextView identifier inside this layout. Please correct me if I am wrong.
Knowing this, I wanted to create my own adapter, but use the same layout resources to ensure interface consistency with the platform. So I tried the following:
mAdapter = new SimpleCursorAdapter( getApplicationContext(), android.R.layout.simple_list_item_1, mSites, new String[] { SitesDatabase.KEY_SITE }, new int[] { android.R.id.text1 } );
Unfortunately, because I use a light theme (I have android:theme="@android:style/Theme.Light" in my <application> ), the list items are displayed with white text, which makes them unreadable.
However, when using android:entries to specify a static list of elements, elements are displayed correctly, with black text.
What am I doing wrong? How to make a dynamic adapter use a standard layout, but work with a light theme?
android listview themes
Felix Jun 08 '10 at 21:33 2010-06-08 21:33
source share