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


Java Email.TYPE_MOBILE属性代码示例

本文整理汇总了Java中android.provider.ContactsContract.CommonDataKinds.Email.TYPE_MOBILE属性的典型用法代码示例。如果您正苦于以下问题:Java Email.TYPE_MOBILE属性的具体用法?Java Email.TYPE_MOBILE怎么用?Java Email.TYPE_MOBILE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.provider.ContactsContract.CommonDataKinds.Email的用法示例。


在下文中一共展示了Email.TYPE_MOBILE属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getAndroidEmailType

public static int getAndroidEmailType(EmailType emailType) {
	switch (emailType) {
	case TYPE_CUSTOM:
		return Email.TYPE_CUSTOM;
	case TYPE_HOME:
		return Email.TYPE_HOME;
	case TYPE_MOBILE:
		return Email.TYPE_MOBILE;
	case TYPE_OTHER:
		return Email.TYPE_OTHER;
	case TYPE_WORK:
		return Email.TYPE_WORK;
	default:
		return Email.TYPE_OTHER;
	}
}
 
开发者ID:mgrieder,项目名称:ntsync-android,代码行数:16,代码来源:ContactManager.java

示例2: getEmailType

public static EmailType getEmailType(int androidEmailType) {
	switch (androidEmailType) {
	case Email.TYPE_CUSTOM:
		return EmailType.TYPE_CUSTOM;
	case Email.TYPE_OTHER:
		return EmailType.TYPE_OTHER;
	case Email.TYPE_HOME:
		return EmailType.TYPE_HOME;
	case Email.TYPE_WORK:
		return EmailType.TYPE_WORK;
	case Email.TYPE_MOBILE:
		return EmailType.TYPE_MOBILE;
	default:
		return EmailType.TYPE_OTHER;
	}
}
 
开发者ID:mgrieder,项目名称:ntsync-android,代码行数:16,代码来源:ContactManager.java

示例3: populateEmailAddresses

protected void populateEmailAddresses(Contact c) throws RemoteException {
	@Cleanup Cursor cursor = providerClient.query(dataURI(), new String[] { Email.TYPE, Email.ADDRESS, Email.LABEL, Email.IS_SUPER_PRIMARY },
			Email.RAW_CONTACT_ID + "=? AND " + Data.MIMETYPE + "=?",
			new String[] { String.valueOf(c.getLocalID()), Email.CONTENT_ITEM_TYPE }, null);
	while (cursor != null && cursor.moveToNext()) {
		ezvcard.property.Email email = new ezvcard.property.Email(cursor.getString(1));
		switch (cursor.getInt(0)) {
		case Email.TYPE_HOME:
			email.addType(EmailType.HOME);
			break;
		case Email.TYPE_WORK:
			email.addType(EmailType.WORK);
			break;
		case Email.TYPE_MOBILE:
			email.addType(Contact.EMAIL_TYPE_MOBILE);
			break;
		case Email.TYPE_CUSTOM:
			String customType = cursor.getString(2);
			if (!StringUtils.isEmpty(customType))
				email.addType(EmailType.get(labelToXName(customType)));
		}
		if (cursor.getInt(3) != 0)	// IS_PRIMARY
			email.addType(EmailType.PREF);
		c.getEmails().add(email);
	}
}
 
开发者ID:eXfio,项目名称:CucumberSync,代码行数:26,代码来源:LocalAddressBook.java

示例4: buildEmail

protected Builder buildEmail(Builder builder, ezvcard.property.Email email) {
	int typeCode = 0;
	String typeLabel = null;
	boolean is_primary = false;
	
	for (EmailType type : email.getTypes())
		if (type == EmailType.PREF)
			is_primary = true;
		else if (type == EmailType.HOME)
			typeCode = Email.TYPE_HOME;
		else if (type == EmailType.WORK)
			typeCode = Email.TYPE_WORK;
		else if (type == Contact.EMAIL_TYPE_MOBILE)
			typeCode = Email.TYPE_MOBILE;
	if (typeCode == 0) {
		if (email.getTypes().isEmpty())
			typeCode = Email.TYPE_OTHER;
		else {
			typeCode = Email.TYPE_CUSTOM;
			typeLabel = xNameToLabel(email.getTypes().iterator().next().getValue());
		}
	}
	
	builder = builder
			.withValue(Data.MIMETYPE, Email.CONTENT_ITEM_TYPE)
			.withValue(Email.ADDRESS, email.getValue())
			.withValue(Email.TYPE, typeCode)
			.withValue(Email.IS_PRIMARY, is_primary ? 1 : 0)
			.withValue(Phone.IS_SUPER_PRIMARY, is_primary ? 1 : 0);;
	if (typeLabel != null)
		builder = builder.withValue(Email.LABEL, typeLabel);
	return builder;
}
 
开发者ID:eXfio,项目名称:CucumberSync,代码行数:33,代码来源:LocalAddressBook.java

示例5: getEmailTypeLabel

private String getEmailTypeLabel(int type, String label) {
    switch (type) {
        case Email.TYPE_HOME:
            return getString(R.string.label_hometag);
        case Email.TYPE_WORK:
            return getString(R.string.label_worktag);
        case Email.TYPE_MOBILE:
            return getString(R.string.label_mobiletag);
        case Email.TYPE_OTHER:
            return getString(R.string.label_othertag);
        default:
            return Email.getTypeLabel(this.getResources(), type, label).toString();
    }
}
 
开发者ID:SafeSlingerProject,项目名称:SafeSlinger-Android,代码行数:14,代码来源:SlingerFragment.java

示例6: appendEmailLine

public void appendEmailLine(final int type, final String label,
        final String rawValue, final boolean isPrimary) {
    final String typeAsString;
    switch (type) {
        case Email.TYPE_CUSTOM: {
            if (VCardUtils.isMobilePhoneLabel(label)) {
                typeAsString = VCardConstants.PARAM_TYPE_CELL;
            } else if (!TextUtils.isEmpty(label)
                    && VCardUtils.containsOnlyAlphaDigitHyphen(label)) {
                typeAsString = "X-" + label;
            } else {
                typeAsString = null;
            }
            break;
        }
        case Email.TYPE_HOME: {
            typeAsString = VCardConstants.PARAM_TYPE_HOME;
            break;
        }
        case Email.TYPE_WORK: {
            typeAsString = VCardConstants.PARAM_TYPE_WORK;
            break;
        }
        case Email.TYPE_OTHER: {
            typeAsString = null;
            break;
        }
        case Email.TYPE_MOBILE: {
            typeAsString = VCardConstants.PARAM_TYPE_CELL;
            break;
        }
        default: {
            Log.e(LOG_TAG, "Unknown Email type: " + type);
            typeAsString = null;
            break;
        }
    }

    final List<String> parameterList = new ArrayList<>();
    if (isPrimary) {
        parameterList.add(VCardConstants.PARAM_TYPE_PREF);
    }
    if (!TextUtils.isEmpty(typeAsString)) {
        parameterList.add(typeAsString);
    }

    appendLineWithCharsetAndQPDetection(VCardConstants.PROPERTY_EMAIL, parameterList,
            rawValue);
}
 
开发者ID:crashlytics,项目名称:digits-android,代码行数:49,代码来源:VCardBuilder.java


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