本文整理汇总了Java中android.provider.ContactsContract.CommonDataKinds.Im.TYPE_HOME属性的典型用法代码示例。如果您正苦于以下问题:Java Im.TYPE_HOME属性的具体用法?Java Im.TYPE_HOME怎么用?Java Im.TYPE_HOME使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类android.provider.ContactsContract.CommonDataKinds.Im
的用法示例。
在下文中一共展示了Im.TYPE_HOME属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAndroidImType
public static int getAndroidImType(ImType type) {
switch (type) {
case TYPE_CUSTOM:
return Im.TYPE_CUSTOM;
case TYPE_HOME:
return Im.TYPE_HOME;
case TYPE_OTHER:
return Im.TYPE_OTHER;
case TYPE_WORK:
return Im.TYPE_WORK;
default:
return Im.TYPE_OTHER;
}
}
示例2: getImType
public static ImType getImType(int androidType) {
switch (androidType) {
case Im.TYPE_CUSTOM:
return ImType.TYPE_CUSTOM;
case Im.TYPE_HOME:
return ImType.TYPE_HOME;
case Im.TYPE_OTHER:
return ImType.TYPE_OTHER;
case Im.TYPE_WORK:
return ImType.TYPE_WORK;
default:
return ImType.TYPE_OTHER;
}
}
示例3: byTypeId
/**
* Retrieve a type instalce for a given database value, or null.
* @param id The database value.
* @return A corresponding Type instance, or null.
*/
private static Type byTypeId(int id) {
switch(id) {
case Im.TYPE_CUSTOM: return CUSTOM;
case Im.TYPE_HOME: return HOME;
case Im.TYPE_OTHER: return OTHER;
case Im.TYPE_WORK: return WORK;
}
return null;
}
示例4: buildIMPP
protected Builder buildIMPP(Builder builder, Impp impp) {
int typeCode = 0;
String typeLabel = null;
for (ImppType type : impp.getTypes())
if (type == ImppType.HOME)
typeCode = Im.TYPE_HOME;
else if (type == ImppType.WORK || type == ImppType.BUSINESS)
typeCode = Im.TYPE_WORK;
if (typeCode == 0)
if (impp.getTypes().isEmpty())
typeCode = Im.TYPE_OTHER;
else {
typeCode = Im.TYPE_CUSTOM;
typeLabel = xNameToLabel(impp.getTypes().iterator().next().getValue());
}
int protocolCode = 0;
String protocolLabel = null;
String protocol = impp.getProtocol();
if (protocol == null) {
Log.w(TAG, "Ignoring IMPP address without protocol");
return null;
}
// SIP addresses are IMPP entries in the VCard but locally stored in SipAddress rather than Im
boolean sipAddress = false;
if (impp.isAim())
protocolCode = Im.PROTOCOL_AIM;
else if (impp.isMsn())
protocolCode = Im.PROTOCOL_MSN;
else if (impp.isYahoo())
protocolCode = Im.PROTOCOL_YAHOO;
else if (impp.isSkype())
protocolCode = Im.PROTOCOL_SKYPE;
else if (protocol.equalsIgnoreCase("qq"))
protocolCode = Im.PROTOCOL_QQ;
else if (protocol.equalsIgnoreCase("google-talk"))
protocolCode = Im.PROTOCOL_GOOGLE_TALK;
else if (impp.isIcq())
protocolCode = Im.PROTOCOL_ICQ;
else if (impp.isXmpp() || protocol.equalsIgnoreCase("jabber"))
protocolCode = Im.PROTOCOL_JABBER;
else if (protocol.equalsIgnoreCase("netmeeting"))
protocolCode = Im.PROTOCOL_NETMEETING;
else if (protocol.equalsIgnoreCase("sip"))
sipAddress = true;
else {
protocolCode = Im.PROTOCOL_CUSTOM;
protocolLabel = protocol;
}
if (sipAddress)
// save as SIP address
builder = builder
.withValue(Data.MIMETYPE, SipAddress.CONTENT_ITEM_TYPE)
.withValue(Im.DATA, impp.getHandle())
.withValue(Im.TYPE, typeCode);
else {
// save as IM address
builder = builder
.withValue(Data.MIMETYPE, Im.CONTENT_ITEM_TYPE)
.withValue(Im.DATA, impp.getHandle())
.withValue(Im.TYPE, typeCode)
.withValue(Im.PROTOCOL, protocolCode);
if (protocolLabel != null)
builder = builder.withValue(Im.CUSTOM_PROTOCOL, protocolLabel);
}
if (typeLabel != null)
builder = builder.withValue(Im.LABEL, typeLabel);
return builder;
}