删除 APN(重置为默认值)
如何从 Android 的 APN 菜单中编程“重置为默认”功能?
我使用了 http://blogs.msdn.com/b/zhengpei/archive/2009/10/13/managing-apn-data-in-google-android.aspx 创建并设置自定义 APN。不过,我想向我的脚本添加功能,以从 APN 列表中删除自定义条目。
有没有办法调用“重置为默认值”功能?
如果没有,如何删除 APN? 谢谢。
How can I program the "Reset to default" function from the APN menu in Android?
I used the code from http://blogs.msdn.com/b/zhengpei/archive/2009/10/13/managing-apn-data-in-google-android.aspx to create and set a custom APN. However, I would like to add functionality to my script to remove the custom entry from the APN list.
Is there a way to call the "Reset to default" function?
If not, how can I remove an APN?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您知道要删除哪个条目,请使用
ContentResolver.delete()
这里的 URI 为:
Uri APN_TABLE_URI = Uri.parse("content://telephony/riers");
和Where
将是一个过滤器,在删除之前应用于行,格式化为 SQL WHERE 子句(不包括 WHERE 本身)。要恢复默认值,您需要首先备份默认 APN ID。如果您备份了它,您可以调用
SetDefaultAPN()
来恢复它。尝试一下,我在 TelephonyProvider.java。这似乎有风险,所以我建议你备份您的 APN
If you know which entry to delete, use
ContentResolver.delete()
Here the URI will be :
Uri APN_TABLE_URI = Uri.parse("content://telephony/carriers");
andWhere
will be a filter to apply to rows before deleting, formatted as an SQL WHERE clause (excluding the WHERE itself).To restore to default you need backup the default APN ID in the first place. If you back it up, you can call
SetDefaultAPN()
to restore it.Try this out though, I saw it in TelephonyProvider.java. It seems risky so I suggest you back up your APN's