Android: How to import contact from phone? [closed]

自古美人都是妖i 提交于 2019-12-10 16:17:13

问题


I am making a contact application. I wish to import all the contacts stored in the phone and sim cards into my application, but I don't know how to write the code. Any help and hints or links to useful answers would be very much appreciated. Thanks for spending your precious time to view this question.


回答1:


You need to use:

Cursor contacts = getContentResolver().query(ContactsContract.Contacts.CONTENT_URI, null, null, null, null);

Here's a complete tutorial on that: http://saigeethamn.blogspot.in/2011/05/contacts-api-20-and-above-android.html



来源:https://stackoverflow.com/questions/20444503/android-how-to-import-contact-from-phone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!