当前位置: 首页>>代码示例>>Java>>正文


Java Intents类代码示例

本文整理汇总了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);
  }
}
 
开发者ID:redcracker,项目名称:TextSecure,代码行数:22,代码来源:ConversationListItem.java

示例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);
}
 
开发者ID:Securecom,项目名称:Securecom-Messaging,代码行数:20,代码来源:ConversationItem.java

示例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;
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:13,代码来源:ContactsUtils3.java

示例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);
}
 
开发者ID:redcracker,项目名称:TextSecure,代码行数:30,代码来源:ConversationItem.java


注:本文中的android.provider.Contacts.Intents类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。