Android 从SIM卡获取联系人信息


Android 从SIM卡获取联系人信息:

  1. /** 
  2.      * 从SIM卡中读取联系人信息 
  3.      * @return 
  4.      */  
  5.     private Cursor getContacts() {  
  6.         Uri uri = Uri.parse("content://icc/adn");//Contacts.People.CONTENT_URI;   
  7. //        Uri uri = Uri.parse("content://sim/adn");   
  8.         String[] projection = new String[] { "name",  
  9.                         "phone" };  
  10.         String selection = null;  
  11.         String[] selectionArgs = null;  
  12.         String sortOrder = "name"//Contacts.People.NAME// Contacts.PeopleColumns.DISPLAY_NAME   
  13.                         + " COLLATE LOCALIZED ASC";  
  14.   
  15.         return managedQuery(uri, projection, selection, selectionArgs,  
  16.                         sortOrder);  
  17.     }  

相关内容