android 從SIM卡獲取聯絡人資訊

月盡天明發表於2012-02-20
01./** 
02.     * 從SIM卡中讀取聯絡人資訊 
03.     * @return 
04.     */  
05.    private Cursor getContacts() {  
06.        Uri uri = Uri.parse("content://icc/adn");//Contacts.People.CONTENT_URI;   
07.//        Uri uri = Uri.parse("content://sim/adn");  
08.        String[] projection = new String[] { "name",  
09.                        "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.    }  

轉自http://blog.csdn.net/qiaoning13256/article/details/7186901

相關文章