小编ram*_* ji的帖子

获取电子邮件类型和电话号码类型的标签使用android

我想获取所使用的类型email typephone number type's标签但是当我使用这些代码获取数据时,它给出的标签使用位置意味着返回integer值,但我想要使用标签.

我的代码错在哪里?

成功完全获得电子邮件ID,但类型给予int.值为1,2.

那么如何获得类型的标签?

public String [] getEmailid(long _id) {
    String emailid = null ;
    String emailType = null ;
    try {
        Cursor cursor = getContentResolver().query(  
            ContactsContract.CommonDataKinds.Email.CONTENT_URI,  
            new String[]{Email.DATA,Email.TYPE},
            ContactsContract.CommonDataKinds.Email.CONTACT_ID +" = "+ _id, 
            // We need to add more selection for phone type
            null,
            null);

        if(cursor != null) {
            while (cursor.moveToNext()) {  
                // This would allow you get several email addresses  
                // if the email addresses were stored …
Run Code Online (Sandbox Code Playgroud)

android contact

10
推荐指数
2
解决办法
9174
查看次数

如何以编程方式删除android mobile上联系人列表中的所有联系人

我想从我的应用程序中删除一个按钮上的所有联系人,所以任何一个好人都可以告诉我如何只通过一个按钮按编程方式从android手机中删除所有联系人?答案将不胜感激......

实际上我在几个小时内冲浪,但没有得到任何适当的答案.这就是为什么我需要在这个不错的论坛中发布我的问题...感谢这样的论坛....

android

6
推荐指数
2
解决办法
9487
查看次数

标签 统计

android ×2

contact ×1