将联系人添加到SIM卡时,仅在重新启动设备后显示联系人 [英] when adding contacts to sim card, they are only displayed after rebooting the device

查看:170
本文介绍了将联系人添加到SIM卡时,仅在重新启动设备后显示联系人的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将联系人添加到SIM卡,它们似乎已添加到SIM卡,但是只有在重新启动设备(甚至是本机的人脉"应用程序)后,它们才可见.

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);

创建联系人后同步联系人数据库是否有问题?如果是这样,有没有办法强迫Android将通讯录的数据库与SIM卡同步?

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?

推荐答案

Android联系人数据库在启动时会同步SIM卡联系人.

Android contacts database synchronizes SIM Cards contacts on boot.

重新启动后,可以通过ContactsContract提供程序看到添加到SIM卡的任何联系人.

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

这篇关于将联系人添加到SIM卡时,仅在重新启动设备后显示联系人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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