diff options
-rw-r--r-- | res/values/cm_strings.xml | 3 | ||||
-rw-r--r-- | src/com/android/settings/ApnEditor.java | 14 |
2 files changed, 15 insertions, 2 deletions
diff --git a/res/values/cm_strings.xml b/res/values/cm_strings.xml index 24d5863..a95a675 100644 --- a/res/values/cm_strings.xml +++ b/res/values/cm_strings.xml @@ -945,4 +945,7 @@ two in order to insert additional control points. \'Remove\' deletes the selecte <string name="screen_off_animation_title">Screen-off animation</string> <string name="screen_off_animation_summary">Show the electron beam animation when the screen is turned off</string> + <!-- Delete apn confirmation dialog message --> + <string name="confirm_delete_apn">The APN will be deleted.</string> + </resources> diff --git a/src/com/android/settings/ApnEditor.java b/src/com/android/settings/ApnEditor.java index 30ba54e..2f2d0c1 100644 --- a/src/com/android/settings/ApnEditor.java +++ b/src/com/android/settings/ApnEditor.java @@ -22,6 +22,7 @@ import android.app.Dialog; import android.content.ContentUris; import android.content.ContentValues; import android.content.CursorLoader; +import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; import android.content.res.Resources; @@ -548,8 +549,17 @@ public class ApnEditor extends SettingsPreferenceFragment } private void deleteApn() { - getContentResolver().delete(mUri, null, null); - finish(); + new AlertDialog.Builder(getActivity()) + .setMessage(R.string.confirm_delete_apn) + .setCancelable(true) + .setPositiveButton(R.string.delete,new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog,int id) { + getContentResolver().delete(mUri, null, null); + finish(); + } + }) + .setNegativeButton(R.string.cancel, null) + .show(); } private String starify(String value) { |