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.
Delete APN (Reset to Default)
8.3k views Asked by Paul At
1
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