I've read through the docs and searched on here, but I'm not quite understanding how all the pieces fit together. Was wondering if anyone has a clear explanation of how to grab a single column of data from Contacts and have it populate an autocomplete box.
Asked
Active
Viewed 1,322 times
0
-
Check [this link](http://stackoverflow.com/questions/2628702/android-autocomplete-with-contacts), duplicate post – fedj Aug 10 '10 at 21:20
1 Answers
0
In onCreate():
Created a SimpleCursor to create a managed query into the contacts database:
Cursor emailAddressCursor = managedQuery(Contacts.ContactMethods.CONTENT_EMAIL_URI, PROJECTION, null, null, Contacts.ContactMethods.DATA + " ASC");
Created a SimpleCursorAdapter to connect data to the cursor.
Implemented setFilterQueryProvider() in my adapter to return a managed query when constraint is passed in when filtering.
The final step is to call setAdapter() on the TextView passing in your adapter.