Hi,
I have a ListActivity for which I am setting up ListAdapter like below:
phoneListAdapter = new SimpleCursorAdapter(this,
R.layout.contacts_list_row,
managedCursor, new String[] { PhonesColumns.NUMBER,
PhonesColumns.TYPE},
new int[] { R.id.text1, R.id.text2 });
setListAdapter(phoneListAdapter);
However, the output here is not readable as PhonesColumns.TYPE is
displaying number strings like 2, 1 etc. A sample output that I get is
like below:
111-222-3333 2
222-333-4444 1
I want to make it more readable by converting them to "Mobile",
"Home", "Work" etc. A sample desired output list is like below:
111-222-3333 MOBILE
222-333-4444 WORK
Essentially, I don't want the columns to be displayed as is. How do I
achieve this ? My contacts_list_row.xml is like below:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView android:id="@+id/text1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView android:id="@+id/text2"
android:paddingLeft="10px"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---