From b844133a3a9f7cdfc255772aae852b0a73788446 Mon Sep 17 00:00:00 2001 From: cyBerta Date: Thu, 2 Jan 2020 23:07:31 +0100 Subject: rename battery flag in navigation drawer --- .../se/leap/bitmaskclient/drawer/NavigationDrawerFragment.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'app/src/main') diff --git a/app/src/main/java/se/leap/bitmaskclient/drawer/NavigationDrawerFragment.java b/app/src/main/java/se/leap/bitmaskclient/drawer/NavigationDrawerFragment.java index 85c982df..de24802a 100644 --- a/app/src/main/java/se/leap/bitmaskclient/drawer/NavigationDrawerFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/drawer/NavigationDrawerFragment.java @@ -118,7 +118,7 @@ public class NavigationDrawerFragment extends Fragment implements SharedPreferen private SharedPreferences preferences; private final static String KEY_SHOW_SAVE_BATTERY_ALERT = "KEY_SHOW_SAVE_BATTERY_ALERT"; - private boolean showEnableExperimentalFeature = false; + private volatile boolean showSaveBattery = false; AlertDialog alertDialog; @Override @@ -430,8 +430,9 @@ public class NavigationDrawerFragment extends Fragment implements SharedPreferen @Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); - if (showEnableExperimentalFeature) { + if (showSaveBattery) { outState.putBoolean(KEY_SHOW_SAVE_BATTERY_ALERT, true); + alertDialog.dismiss(); } } @@ -449,7 +450,7 @@ public class NavigationDrawerFragment extends Fragment implements SharedPreferen try { AlertDialog.Builder alertBuilder = new AlertDialog.Builder(getActivity()); - showEnableExperimentalFeature = true; + showSaveBattery = true; alertDialog = alertBuilder .setTitle(activity.getString(R.string.save_battery)) .setMessage(activity.getString(R.string.save_battery_message)) -- cgit v1.2.3