Sarath Kamisetty wrote:
> Hi,
>
> I have one more question on this. The following query returns all the
> contacts in the phone.
>
> private String[] projection = new String[] {
> People._ID,
> People.NAME,
> People.NUMBER,
> };
>
> managedCursor = managedQuery(People.CONTENT_URI,
> projection,
> null,
> null,
> People.NAME + " ASC");
>
> How do I modify this to get only the mobile numbers ? I am not
> interested in the contacts that don't have mobile numbers. I am not
> sure which column to project. I tried using TYPE and TYPE_MOBILEs but
> no luck. Please let me know if you have any suggestions.
You need to replace your two null values in your managedQuery() call
with appropriate values that add a constraint upon your query to return
only mobile numbers. I haven't played around with the Contacts content
provider enough yet to provide exact source code.
--
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 1.9 Available!
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---