diff --git a/wear/src/main/java/info/nightscout/androidaps/data/ListenerService.java b/wear/src/main/java/info/nightscout/androidaps/data/ListenerService.java index 1025f78b06..e58d886f0e 100644 --- a/wear/src/main/java/info/nightscout/androidaps/data/ListenerService.java +++ b/wear/src/main/java/info/nightscout/androidaps/data/ListenerService.java @@ -532,7 +532,7 @@ public class ListenerService extends WearableListenerService implements GoogleAp SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this); SharedPreferences.Editor editor = sharedPreferences.edit(); editor.putBoolean("wearcontrol", wearcontrol); - editor.commit(); + editor.apply(); } } else if (path.equals(NEW_CHANGECONFIRMATIONREQUEST_PATH)) { String title = DataMapItem.fromDataItem(event.getDataItem()).getDataMap().getString("title"); diff --git a/wear/src/main/java/info/nightscout/androidaps/watchfaces/BIGChart.java b/wear/src/main/java/info/nightscout/androidaps/watchfaces/BIGChart.java index 492e77cd05..d7d6db0cfa 100644 --- a/wear/src/main/java/info/nightscout/androidaps/watchfaces/BIGChart.java +++ b/wear/src/main/java/info/nightscout/androidaps/watchfaces/BIGChart.java @@ -193,7 +193,7 @@ public class BIGChart extends WatchFace implements SharedPreferences.OnSharedPre private void changeChartTimeframe() { int timeframe = Integer.parseInt(sharedPrefs.getString("chart_timeframe", "3")); timeframe = (timeframe%5) + 1; - sharedPrefs.edit().putString("chart_timeframe", "" + timeframe).commit(); + sharedPrefs.edit().putString("chart_timeframe", "" + timeframe).apply(); } protected void onWatchModeChanged(WatchMode watchMode) { diff --git a/wear/src/main/java/info/nightscout/androidaps/watchfaces/Home.java b/wear/src/main/java/info/nightscout/androidaps/watchfaces/Home.java index f1929434f3..ce84f97e46 100644 --- a/wear/src/main/java/info/nightscout/androidaps/watchfaces/Home.java +++ b/wear/src/main/java/info/nightscout/androidaps/watchfaces/Home.java @@ -55,7 +55,7 @@ public class Home extends BaseWatchFace { private void changeChartTimeframe() { int timeframe = Integer.parseInt(sharedPrefs.getString("chart_timeframe", "3")); timeframe = (timeframe%5) + 1; - sharedPrefs.edit().putString("chart_timeframe", "" + timeframe).commit(); + sharedPrefs.edit().putString("chart_timeframe", "" + timeframe).apply(); } @Override diff --git a/wear/src/main/java/info/nightscout/androidaps/watchfaces/Home2.java b/wear/src/main/java/info/nightscout/androidaps/watchfaces/Home2.java index 582bcd761f..f83c7f2b5b 100644 --- a/wear/src/main/java/info/nightscout/androidaps/watchfaces/Home2.java +++ b/wear/src/main/java/info/nightscout/androidaps/watchfaces/Home2.java @@ -56,7 +56,7 @@ public class Home2 extends BaseWatchFace { private void changeChartTimeframe() { int timeframe = Integer.parseInt(sharedPrefs.getString("chart_timeframe", "3")); timeframe = (timeframe%5) + 1; - sharedPrefs.edit().putString("chart_timeframe", "" + timeframe).commit(); + sharedPrefs.edit().putString("chart_timeframe", "" + timeframe).apply(); } @Override diff --git a/wear/src/main/java/info/nightscout/androidaps/watchfaces/Steampunk.java b/wear/src/main/java/info/nightscout/androidaps/watchfaces/Steampunk.java index 809a9ce850..8368ebd5fe 100644 --- a/wear/src/main/java/info/nightscout/androidaps/watchfaces/Steampunk.java +++ b/wear/src/main/java/info/nightscout/androidaps/watchfaces/Steampunk.java @@ -264,6 +264,6 @@ public class Steampunk extends BaseWatchFace { pointSize = 1; } setupCharts(); - sharedPrefs.edit().putString("chart_timeframe", "" + timeframe).commit(); + sharedPrefs.edit().putString("chart_timeframe", "" + timeframe).apply(); } } \ No newline at end of file