I want to display all contacts with a phone number in a list. I got
the data, it is displayed in the list but my problem is that I can't
get the text filter functionality to work. E.g. when the user types
'fre' it should filter out all entries not containing 'fre'.
This is what I've got in the ListActivity.onCreate()
[syntax="java"]
Cursor c = this.getContentResolver().query(People.CONTENT_URI,
new String[] { People._ID, People.DISPLAY_NAME },
People.PRIMARY_PHONE_ID + " IS NOT NULL",
null,
People.DISPLAY_NAME + " asc");
this.startManagingCursor(c);
SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,
android.R.layout.simple_list_item_1,
c,
new String[] { People.DISPLAY_NAME },
new int[] { android.R.id.text1 });
adapter.setStringConversionColumn(adapter.getCursor().getColumnIndex
(People.DISPLAY_NAME));
adapter.bindView(getListView(), this, c);
setListAdapter(adapter);
this.getListView().setTextFilterEnabled(true);
[/syntax]
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---