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


Java Email.CONTENT_ITEM_TYPE属性代码示例

本文整理汇总了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;

}
 
开发者ID:philipwhiuk,项目名称:q-mail,代码行数:20,代码来源:RecipientLoader.java

示例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);
    }
}
 
开发者ID:scoute-dich,项目名称:K9-MailClient,代码行数:23,代码来源:RecipientLoader.java

示例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);
    }
 
开发者ID:SafeSlingerProject,项目名称:SafeSlinger-Android,代码行数:16,代码来源:ContactAccessorApi5.java

示例4: getEmailType

/**
 * Get Email.CONTENT_ITEM_TYPE.
 */
public static String getEmailType() {
  return Email.CONTENT_ITEM_TYPE;
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:6,代码来源:HoneycombMR1Util.java


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