Well instead of using
try
SimpleCursorAdapter sAdapter = new SimpleCursorAdapter
(this,
R.layout.menulist_complexitem,
cursor,
new String[] {
People.NAME, // column containing the
name
People.PRIMARY_PHONE_ID // column
containing the ID, which
you can use to get the phone number from doing a query on
Phones.CONTENT_URI instead of People.CONTENT_URI
}, new int[] {
R.id.name, // ID of the TextView you
want to display the
name
R.id.phone_id // ID of the TextView you
want to display
the ID
}
);
where R.layout.menulist_complexitem is the layout file for your
pulldown item view and R.id.name/R.id.phone_id are the two ids of the
TextViews inside the menulist_complexitem.xml.
Probably you'd need to make your own Adapter extending CursorAdapter
which will use the Contacts.People._ID to find all phone numbers
associated with the user and add them to the list and adding a View
element for conctact (i.e. if a Contact has more than 1 phone number)
On Jan 16, 2:03 pm, Miguel Paraz <[email protected]> wrote:
> Hi,
> How can I have a AutoCompleteTextView which autocompletes from the
> Contacts, the way the Messaging app does?
>
> It's possible to read the contacts from the Contacts provider, and use
> this for the AutoCompleteTextView's adapter. But, how does the
> Messaging app show two lines with the contact name and the type of
> information (home, mobile, other) in gray?
>
> Thanks!
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---