本文整理汇总了Java中android.provider.Contacts.Intents类的典型用法代码示例。如果您正苦于以下问题:Java Intents类的具体用法?Java Intents怎么用?Java Intents使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Intents类属于android.provider.Contacts包,在下文中一共展示了Intents类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setContactPhoto
import android.provider.Contacts.Intents; //导入依赖的package包/类
private void setContactPhoto(final Recipient recipient) {
if (recipient == null) return;
contactPhotoImage.setImageBitmap(recipient.getCircleCroppedContactPhoto());
if (!recipient.isGroupRecipient()) {
contactPhotoImage.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (recipient.getContactUri() != null) {
QuickContact.showQuickContact(context, contactPhotoImage, recipient.getContactUri(), QuickContact.MODE_LARGE, null);
} else {
Intent intent = new Intent(Intents.SHOW_OR_CREATE_CONTACT, Uri.fromParts("tel", recipient.getNumber(), null));
context.startActivity(intent);
}
}
});
} else {
contactPhotoImage.setOnClickListener(null);
}
}
示例2: setContactPhotoForRecipient
import android.provider.Contacts.Intents; //导入依赖的package包/类
private void setContactPhotoForRecipient(final Recipient recipient) {
if (contactPhoto == null) return;
contactPhoto.setImageBitmap(recipient.getCircleCroppedContactPhoto());
contactPhoto.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (recipient.getContactUri() != null) {
QuickContact.showQuickContact(context, contactPhoto, recipient.getContactUri(), QuickContact.MODE_LARGE, null);
} else {
Intent intent = new Intent(Intents.SHOW_OR_CREATE_CONTACT, Uri.fromParts("tel", recipient.getNumber(), null));
context.startActivity(intent);
}
}
});
contactPhoto.setVisibility(View.VISIBLE);
}
示例3: getAddContactIntent
import android.provider.Contacts.Intents; //导入依赖的package包/类
@Override
public Intent getAddContactIntent(String displayName, String csipUri) {
Intent intent = new Intent(Intents.Insert.ACTION);
if(!TextUtils.isEmpty(displayName)) {
intent.putExtra(Intents.Insert.NAME, displayName);
}
intent.putExtra(Intents.Insert.IM_HANDLE, csipUri);
intent.putExtra(Intents.Insert.IM_PROTOCOL, SipManager.PROTOCOL_CSIP);
return intent;
}
示例4: setContactPhotoForRecipient
import android.provider.Contacts.Intents; //导入依赖的package包/类
private void setContactPhotoForRecipient(final Recipient recipient) {
if (contactPhoto == null) return;
Bitmap contactPhotoBitmap;
if ((recipient.getContactPhoto() == ContactPhotoFactory.getDefaultContactPhoto(context)) && (groupThread)) {
contactPhotoBitmap = recipient.getGeneratedAvatar(context);
} else {
contactPhotoBitmap = recipient.getCircleCroppedContactPhoto();
}
contactPhoto.setImageBitmap(contactPhotoBitmap);
contactPhoto.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (recipient.getContactUri() != null) {
QuickContact.showQuickContact(context, contactPhoto, recipient.getContactUri(), QuickContact.MODE_LARGE, null);
} else {
final Intent intent = new Intent(Intent.ACTION_INSERT_OR_EDIT);
intent.putExtra(ContactsContract.Intents.Insert.PHONE, recipient.getNumber());
intent.setType(ContactsContract.Contacts.CONTENT_ITEM_TYPE);
context.startActivity(intent);
}
}
});
contactPhoto.setVisibility(View.VISIBLE);
}