Use new apply() instead of commit().

apply() starts an async disk write and doesn't have a return
value but is otherwise identical in observable effects.

Change-Id: I0f528607319d7eb5136bb11fce0b24d8741ccdf9
This commit is contained in:
Brad Fitzpatrick
2010-09-14 09:26:51 -07:00
parent e714898a1a
commit c5c8dad0af
5 changed files with 9 additions and 10 deletions

View File

@@ -788,14 +788,14 @@ public class DockService extends Service implements AlertDialog.OnMultiChoiceCli
SharedPreferences.Editor editor = getSharedPreferences(SHARED_PREFERENCES_NAME,
Context.MODE_PRIVATE).edit();
editor.putBoolean(key, bool);
editor.commit();
editor.apply();
}
private void setSettingInt(String key, int value) {
SharedPreferences.Editor editor = getSharedPreferences(SHARED_PREFERENCES_NAME,
Context.MODE_PRIVATE).edit();
editor.putInt(key, value);
editor.commit();
editor.apply();
}
private void removeSetting(String key) {
@@ -803,8 +803,7 @@ public class DockService extends Service implements AlertDialog.OnMultiChoiceCli
Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sharedPref.edit();
editor.remove(key);
editor.commit();
return;
editor.apply();
}
public synchronized void onServiceConnected() {