我想知道由"contactID“或"PhoneNumber”打开contactID,然后启动活动
看上去像这样

本教程看上去不错:如何使用快速接触徽章-android
例如:我有通过ID打开联系人的函数,我想要类似于这个函数的方式,但是对于QuickContactBadge
Intent intent = new Intent(Intent.ACTION_VIEW);
Uri uri = Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_URI, String.valueOf(mPerson.getContactID()));
intent.setData(uri);
context.startActivity(intent);发布于 2014-07-31 06:31:02
从Android4.4.4提取的代码示例
final Cursor cursor = mContext.getContentResolver().query(
Profile.CONTENT_URI, null, null, null, null);
if (cursor.moveToNext() && !cursor.isNull(0)) {
Intent intent = ContactsContract.QuickContact.composeQuickContactsIntent(
mContext, v, ContactsContract.Profile.CONTENT_URI,
ContactsContract.QuickContact.MODE_LARGE, null);
mContext.startActivityAsUser(intent, new UserHandle(UserHandle.USER_CURRENT));通过联系人ID打开快速联系人
Uri uri = Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_URI, String.valueOf(contact_id));
Intent intent = ContactsContract.QuickContact.composeQuickContactsIntent(
mContext, v, uri,
ContactsContract.QuickContact.MODE_LARGE, null);
mContext.startActivity(intent);https://stackoverflow.com/questions/24773267
复制相似问题