Mr_sum
Mr_sum
  • 发布:2015-02-07 21:50
  • 更新:2016-02-29 18:51
  • 阅读:1749

Contacts API在某些安卓系统上面有BUG

分类:5+ SDK

出问题的系统一台是华为 EMUI3系统(安卓4.4),另一台是三星Galaxy Note II(安卓4.3系统);

问题表现:

addressbook.find的contactFields参数 本来是个选填项,但这两部机器上面必须填才能获取到联系人。
并且例如获取三个项,displayName,phoneNumbers,photos, 这个联系人的phoneNumbers项没有填写,那么这个api直接出错,什么都不返回。

而其他机器上面即使某一项没填写,也能正常获取联系人。

2015-02-07 21:50 负责人:无 分享
已邀请:
Android_磊子

Android_磊子

我们查一下吧,后期你联系下我qq609029981。

别闹我有枪

别闹我有枪

我是华为的手机测试。通过

var contact = addressbook.create();  
    contact.name = {givenName:dc.name};  
    contact.phoneNumbers = [{type:"mobile",value:dc.phone,preferred:true}];  
    contact.save();

存上号码之后 ,可以用接口 addressbook.find 出来,但是 手机上的联系人 却一个都没有 是什么原因?

我用json 查看了, 联系人读出来的数据结构一模一样。但是就是手机上的联系人 却一个都没有!

{"data":[{"id":155,"rawId":null,"target":0,"displayName":"记你","name":null,"nickname":null,"phoneNumbers":[{"type":"mobile","value":"13113256458","id":"312","pref":false}],"emails":null,"addresses":null,"ims":null,"organizations":null,"birthday":null,"note":null,"photos":null,"categories":null,"urls":null},{"id":156,"rawId":null,"target":0,"displayName":"张伟","name":null,"nickname":null,"phoneNumbers":[{"type":"mobile","value":"13113256487","id":"314","pref":false}],"emails":null,"addresses":null,"ims":null,"organizations":null,"birthday":null,"note":null,"photos":null,"categories":null,"urls":null},{"id":157,"rawId":null,"target":0,"displayName":"彭先生","name":null,"nickname":null,"phoneNumbers":[{"type":"mobile","value":"11127788052","id":"316","pref":false}],"emails":null,"addresses":null,"ims":null,"organizations":null,"birthday":null,"note":null,"photos":null,"categories":null,"urls":null}]}

该问题目前已经被锁定, 无法添加新回复