Hi,

This one worked for phone numbers, thanks!

On Jan 17, 1:19 am, Odessa Silverberg
<[email protected]> wrote:
> Well instead of using
>
> try
>                SimpleCursorAdaptersAdapter = newSimpleCursorAdapter
> (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 ofPeople.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.


However, for more customized code:

> 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 aContacthas more than 1 phone number)

To get the list of contact names and emails, I'm trying to avoid an
explicit SQL query and join.

But it seems that there is no builtin URI that will provide this
information in a readily available form.


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to