apply instead of commit
This commit is contained in:
parent
e8b9be3754
commit
720307160b
5 changed files with 5 additions and 5 deletions
|
@ -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");
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue