下面列出了android.provider.ContactsContract.CommonDataKinds.Im#PROTOCOL_ICQ 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
/**
* Retrieve the Protocol instance for a given raw database value.
* @param id The raw database value.
* @return The corresponding Protocol instance, or null.
*/
public static Protocol byProtocolId(int id) {
switch(id) {
case Im.PROTOCOL_CUSTOM: return CUSTOM;
case Im.PROTOCOL_AIM: return AIM;
case Im.PROTOCOL_MSN: return MSN;
case Im.PROTOCOL_YAHOO: return YAHOO;
case Im.PROTOCOL_SKYPE: return SKYPE;
case Im.PROTOCOL_QQ: return QQ;
case Im.PROTOCOL_GOOGLE_TALK: return GOOGLE_TALK;
case Im.PROTOCOL_ICQ: return ICQ;
case Im.PROTOCOL_JABBER: return JABBER;
case Im.PROTOCOL_NETMEETING: return NETMEETING;
}
return null;
}
private String getProtocolName(String protocolId, String customProtocol) {
if (protocolId == null) {
throw new InvalidCursorTypeException();
}
switch (Integer.valueOf(protocolId)) {
case Im.PROTOCOL_AIM:
return "AIM";
case Im.PROTOCOL_MSN:
return "MSN";
case Im.PROTOCOL_YAHOO:
return "Yahoo";
case Im.PROTOCOL_SKYPE:
return "Skype";
case Im.PROTOCOL_QQ:
return "QQ";
case Im.PROTOCOL_GOOGLE_TALK:
return "Google Talk";
case Im.PROTOCOL_ICQ:
return "ICQ";
case Im.PROTOCOL_JABBER:
return "Jabber";
case Im.PROTOCOL_NETMEETING:
return "NetMeeting";
case Im.PROTOCOL_CUSTOM:
return customProtocol;
default:
return "Other";
}
}