开发者

How to retrieve contacts from emulator to my application in android?

I want to create a contact list applic开发者_StackOverflow社区ation in my android phone. I want to retrieve all the contact list from emulator and the contacts should be listed.


Even API Demo samples has a similar program

Cursor c = getContentResolver().query(Phones.CONTENT_URI, null, null, null, null);
startManagingCursor(c);            
// Map Cursor columns to views defined in simple_list_item_2.xml
ListAdapter adapter = new SimpleCursorAdapter(this,
android.R.layout.simple_list_item_2, c, 
new String[] { Phones.NAME, Phones.NUMBER },
new int[] { android.R.id.text1, android.R.id.text2 });
setListAdapter(adapter);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜