Linux教程網
Android 從SIM卡獲取聯系人信息:
- /**
- * 從SIM卡中讀取聯系人信息
- * @return
- */
- private Cursor getContacts() {
- Uri uri = Uri.parse("content://icc/adn");//Contacts.People.CONTENT_URI;
- // Uri uri = Uri.parse("content://sim/adn");
- String[] projection = new String[] { "name",
- "phone" };
- String selection = null;
- String[] selectionArgs = null;
- String sortOrder = "name"//Contacts.People.NAME// Contacts.PeopleColumns.DISPLAY_NAME
- + " COLLATE LOCALIZED ASC";
-
- return managedQuery(uri, projection, selection, selectionArgs,
- sortOrder);
- }
Copyright ©
Linux教程網 All Rights Reserved