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

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



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

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