diff options
author | Roman Birg <roman@cyngn.com> | 2015-01-07 11:31:03 -0800 |
---|---|---|
committer | Adnan Begovic <adnan@cyngn.com> | 2015-10-26 16:11:13 -0700 |
commit | 80f283e3000d237707b724932a3b9e99c038518e (patch) | |
tree | 3565b29c5df0048e10d5147ae8d9811b067ea2db /src/com/android/settings/profiles | |
parent | 1f8655e86a1d3b4325f857ec00e1d881ccced824 (diff) | |
download | packages_apps_Settings-80f283e3000d237707b724932a3b9e99c038518e.zip packages_apps_Settings-80f283e3000d237707b724932a3b9e99c038518e.tar.gz packages_apps_Settings-80f283e3000d237707b724932a3b9e99c038518e.tar.bz2 |
Settings: add delete confirmation dialog for profiles
Change-Id: I22744bb55e2800e6ad3d7d6a164df6e5024e15ca
Signed-off-by: Roman Birg <roman@cyngn.com>
Diffstat (limited to 'src/com/android/settings/profiles')
-rw-r--r-- | src/com/android/settings/profiles/SetupActionsFragment.java | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/com/android/settings/profiles/SetupActionsFragment.java b/src/com/android/settings/profiles/SetupActionsFragment.java index ee04032..d06cf9c 100644 --- a/src/com/android/settings/profiles/SetupActionsFragment.java +++ b/src/com/android/settings/profiles/SetupActionsFragment.java @@ -198,8 +198,7 @@ public class SetupActionsFragment extends SettingsPreferenceFragment public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case MENU_REMOVE: - mProfileManager.removeProfile(mProfile); - finishFragment(); + requestRemoveProfileDialog(); return true; } return super.onOptionsItemSelected(item); @@ -250,6 +249,21 @@ public class SetupActionsFragment extends SettingsPreferenceFragment : R.string.profile_setup_actions_title_config); } + private void requestRemoveProfileDialog() { + AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); + builder.setMessage(getString(R.string.profile_remove_dialog_message, mProfile.getName())); + builder.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + dialog.dismiss(); + mProfileManager.removeProfile(mProfile); + finishFragment(); + } + }); + builder.setNegativeButton(R.string.no, null); + builder.show(); + } + private void requestLockscreenModeDialog() { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); final String[] lockEntries = |