我想获取所使用的类型email type和phone 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手机中删除所有联系人?答案将不胜感激......
实际上我在几个小时内冲浪,但没有得到任何适当的答案.这就是为什么我需要在这个不错的论坛中发布我的问题...感谢这样的论坛....