Try to use:

android.provider.ContactsContract.Contacts.CONTENT_URI



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
--~--~---------~--~----~------------~-------~--~----~
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to