2012-03-10 73 views
0

我正在使用意圖顯示聯繫人列表。從聯繫人我想獲得聯繫信息,如名字,第二名,emailid,電話號碼。我希望所選聯繫人的所有信息位於onActivityForResult()如何從Android中的Intent獲取聯繫信息?

Intent intent = new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI); 
startActivityForResult(intent, 1); 
+0

那麼ü想要什麼??????????? – 2012-03-10 06:13:50

回答

4

這已經回答了很多次,請檢查這些帖子出來:

How to read contacts on Android 2.0

get contact info from android contact picker

How to call Android contacts list?

谷歌Android開發者之證件:

@Override 
public Loader<Cursor> onCreateLoader(int loaderId, Bundle args) { 
    /* 
    * Appends the search string to the base URI. Always 
    * encode search strings to ensure they're in proper 
    * format. 
    */ 
    Uri contentUri = Uri.withAppendedPath(Contacts.CONTENT_FILTER_URI, Uri.encode(mSearchString)); 

    return new CursorLoader(
     getActivity(), 
     contentUri, 
     PROJECTION, 
     null, 
     null, 
     null 
    ); 
} 

來源: http://developer.android.com/training/contacts-provider/retrieve-names.html

+1

請關注所有網站 – 2012-03-10 06:14:14

相關問題