when adding contacts to sim card, they are only displayed after rebooting the device

五迷三道 提交于 2019-12-24 04:48:13

问题


I am trying to add contacts to SIM Card, they seem to be added to the SIM Card but they're only visible after rebooting the device (even to the native People app)..

Here is the code I'm using:

final Uri uri = Uri.parse("content://icc/adn");
ContentValues mContentValue = new ContentValues();
mContentValue.put("tag", contactName);
mContentValue.put("number", contactNumber);
getContentResolver().insert(uri, mContentValue);

is it a problem with sync'ing the contacts db after creating the contacts? if so, is there a way, may be, to force android to sync the contacts' database with the SIM Card?


回答1:


Android contacts database synchronizes SIM Cards contacts on boot.

Any contacts added to the SIM card will be visible via the ContactsContract providers after reboot.



来源:https://stackoverflow.com/questions/24485735/when-adding-contacts-to-sim-card-they-are-only-displayed-after-rebooting-the-de

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!