2012-03-10 80 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

相关问题