Hi all,
I am trying to create a Spinner with data extracted from a DB.
This is the code:
private static String[] FROM = {"material"};
private static int[] TO = {R.id.listitem_name};
...
spn1 = (Spinner)findViewById(R.id.spinner1);
Cursor cur1 = this.dbhelper.getTessuti(this);
spn1.setAdapter(new SimpleCursorAdapter(this, R.layout.listitem, cur1,
FROM, TO));
The listitem is defined as
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/listitem_name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:singleLine="true"
android:textSize="20dp"
android:padding="6dp"
/>
</LinearLayout>
Tha problem is that both the spinner text and the popup list are "greyed
out" (grey text on white background, instead of black text).
I don't want to force the color with android:textColor, because someone
could have a black theme (me, on my GalaxoHero-powered Galaxy :) ), but
don't understand why it is greyed.
I could also use standard Android spinner listitems, but I don't
understand what to write in the TO array (in the SimpleCursorAdapter
parameter). I always get blank lines both in the spinner and in the
popup. :(
Thanks for any help!
Bye.
--
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en