读取用户定义的数据字段的Andr​​oid通讯录 [英] read user defined data fields android contacts

查看:122
本文介绍了读取用户定义的数据字段的Andr​​oid通讯录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想读我加入与谷歌的联系,我的联系人的字段。结果
我知道,这些领域获得同步的,因为我可以用另一种接触查看器应用程序看到它。 - >联系查看由SoftWyer结果
我怎么可以查询这些数据?

在此先感谢!


解决方案

  ContentResolver的CR = getContentResolver();
字符串选择= ContactsContract.Data.MIMETYPE +=? ;
的String [] = selectionParams新的String []
  {vnd.com.google.cursor.item / contact_user_defined_field};光标tokenCur = cr.query(
ContactsContract.Data.CONTENT_URI,
空值,
选择,
selectionParams,
空值);

I'm trying to read the fields which I added with google contacts to my contacts.
I know that these fields get synced, because i can see it with an alternative contact viewer app. ->Contact View by SoftWyer
How could i query this data?

Thanks in advance!

解决方案

ContentResolver cr = getContentResolver();
String selection = ContactsContract.Data.MIMETYPE + " = ?" ;
String[] selectionParams = new String[]    
  {"vnd.com.google.cursor.item/contact_user_defined_field"};

Cursor tokenCur = cr.query(
ContactsContract.Data.CONTENT_URI,
null,
selection ,
selectionParams ,
null);

这篇关于读取用户定义的数据字段的Andr​​oid通讯录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆