本文整理汇总了Java中android.provider.ContactsContract.CommonDataKinds.Email.CONTENT_ITEM_TYPE属性的典型用法代码示例。如果您正苦于以下问题:Java Email.CONTENT_ITEM_TYPE属性的具体用法?Java Email.CONTENT_ITEM_TYPE怎么用?Java Email.CONTENT_ITEM_TYPE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类android.provider.ContactsContract.CommonDataKinds.Email
的用法示例。
在下文中一共展示了Email.CONTENT_ITEM_TYPE属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: fillContactDataFromNameAndEmail
private boolean fillContactDataFromNameAndEmail(String query, List<Recipient> recipients,
Map<String, Recipient> recipientMap) {
query = "%" + query + "%";
Uri queryUri = Email.CONTENT_URI;
String selection = Contacts.DISPLAY_NAME_PRIMARY + " LIKE ? " +
" OR (" + Email.ADDRESS + " LIKE ? AND " + Data.MIMETYPE + " = '" + Email.CONTENT_ITEM_TYPE + "')";
String[] selectionArgs = { query, query };
Cursor cursor = contentResolver.query(queryUri, PROJECTION, selection, selectionArgs, SORT_ORDER);
if (cursor == null) {
return false;
}
fillContactDataFromCursor(cursor, recipients, recipientMap);
return true;
}
示例2: fillContactDataFromQuery
private void fillContactDataFromQuery(String query, List<Recipient> recipients,
Map<String, Recipient> recipientMap) {
ContentResolver contentResolver = getContext().getContentResolver();
query = "%" + query + "%";
Uri queryUri = ContactsContract.CommonDataKinds.Email.CONTENT_URI;
String selection = Contacts.DISPLAY_NAME_PRIMARY + " LIKE ? " +
" OR (" + Email.ADDRESS + " LIKE ? AND " + Data.MIMETYPE + " = '" + Email.CONTENT_ITEM_TYPE + "')";
String[] selectionArgs = { query, query };
Cursor cursor = contentResolver.query(queryUri, PROJECTION, selection, selectionArgs, SORT_ORDER);
if (cursor == null) {
return;
}
fillContactDataFromCursor(cursor, recipients, recipientMap);
if (observerContact != null) {
observerContact = new ForceLoadContentObserver();
contentResolver.registerContentObserver(queryUri, false, observerContact);
}
}
示例3: updateEmail
private boolean updateEmail(ContactMethod cmethod, String rawContactId, Context ctx) {
// seek for raw contact + email = same
String[] proj = new String[] {
Email.RAW_CONTACT_ID, Data.MIMETYPE, Email.DATA
};
String where = Email.RAW_CONTACT_ID + "=? AND " + Data.MIMETYPE + "=? AND " + Email.DATA
+ "=?";
String[] args = new String[] {
rawContactId, Email.CONTENT_ITEM_TYPE, cmethod.data
};
ContentValues values = valuesEmail(cmethod);
values.put(Email.RAW_CONTACT_ID, rawContactId);
return updateDataRow(ctx, proj, where, args, values);
}
示例4: getEmailType
/**
* Get Email.CONTENT_ITEM_TYPE.
*/
public static String getEmailType() {
return Email.CONTENT_ITEM_TYPE;
}