Friday, October 30, 2009

[android-developers] Re: Can't query contacts in Android 2.0 emulator?


On Fri, Oct 30, 2009 at 7:25 PM, agirardello <andrea.girardello@gmail.com> wrote:

Try to use:

android.provider.ContactsContract.Contacts.CONTENT_URI

It works. Thanks!



On Oct 28, 7:10 am, Yao <cicikaka2...@gmail.com> wrote:
> Hi guys,
>
> I can't get contacts via content provider in Android 2.0 emulator. The test
> code is pasted. When I click "Account" in the menu, it shows "Force close".
> Thanks a lot in advance for your help!
>
>    Cursor cursor = getContentResolver().query(Contacts.People.CONTENT_URI,
> new String[] {"_id"}, null, null, null);
>         while(cursor.moveToNext()) {
>             String id = cursor.getString(0);
>             Log.e("test", id);
>         }
>         cursor.close();
>
> --
> Best regards,
> MTM
> Contacts GroupU - Group your Android Contactshttp://contacts-groupu.appspot.com




--
Best regards,
MTM
Contacts GroupU - Group your Android Contacts
http://contacts-groupu.appspot.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate