问题
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