lint: use preferenceeditor.apply instead of commit

This commit is contained in:
Andrew Dolgov 2015-06-06 11:29:30 +03:00
parent 75b86b94bb
commit 3d23124f72
7 changed files with 13 additions and 13 deletions

View File

@ -80,7 +80,7 @@ public class CommonActivity extends ActionBarActivity {
public void setUnreadOnly(boolean unread) {
SharedPreferences.Editor editor = m_prefs.edit();
editor.putBoolean("show_unread_only", unread);
editor.commit();
editor.apply();
}
public void toast(int msgId) {

View File

@ -97,7 +97,7 @@ public class FeedsActivity extends OnlineActivity implements HeadlinesEventListe
if (m_prefs.getBoolean("drawer_open_on_start", true)) {
SharedPreferences.Editor editor = m_prefs.edit();
editor.putBoolean("drawer_open_on_start", false);
editor.commit();
editor.apply();
}
invalidateOptionsMenu();

View File

@ -216,7 +216,7 @@ public class OnlineActivity extends CommonActivity {
SharedPreferences localPrefs = getSharedPreferences("localprefs", Context.MODE_PRIVATE);
SharedPreferences.Editor editor = localPrefs.edit();
editor.putBoolean("offline_mode_active", true);
editor.commit();
editor.apply();
Intent offline = new Intent(
OnlineActivity.this,
@ -388,7 +388,7 @@ public class OnlineActivity extends CommonActivity {
SharedPreferences.Editor editor = m_prefs.edit();
editor.putBoolean("offline_mode_active", true);
editor.commit();
editor.apply();
Intent offline = new Intent(OnlineActivity.this, OfflineActivity.class);
offline.putExtra("initial", true);
@ -483,7 +483,7 @@ public class OnlineActivity extends CommonActivity {
SharedPreferences.Editor editor = m_prefs.edit();
editor.putLong("date_firstlaunch_trial", firstStart);
editor.commit();
editor.apply();
}
if (!notify && System.currentTimeMillis() > firstStart + (TRIAL_DAYS * 24 * 60 * 60 * 1000)) {
@ -1723,13 +1723,13 @@ public class OnlineActivity extends CommonActivity {
public void setSortMode(String sortMode) {
SharedPreferences.Editor editor = m_prefs.edit();
editor.putString("headlines_sort_mode", sortMode);
editor.commit();
editor.apply();
}
public void setViewMode(String viewMode) {
SharedPreferences.Editor editor = m_prefs.edit();
editor.putString("view_mode", viewMode);
editor.commit();
editor.apply();
}
public String getViewMode() {

View File

@ -606,7 +606,7 @@ public class OfflineActivity extends CommonActivity {
SharedPreferences localPrefs = getSharedPreferences("localprefs", Context.MODE_PRIVATE);
SharedPreferences.Editor editor = localPrefs.edit();
editor.putBoolean("offline_mode_active", false);
editor.commit();
editor.apply();
Intent refresh = new Intent(this, org.fox.ttrss.OnlineActivity.class);
startActivity(refresh);
@ -808,7 +808,7 @@ public class OfflineActivity extends CommonActivity {
public void setViewMode(String viewMode) {
SharedPreferences.Editor editor = m_prefs.edit();
editor.putString("offline_view_mode", viewMode);
editor.commit();
editor.apply();
}
/* public boolean getOldestFirst() {

View File

@ -161,7 +161,7 @@ public class OfflineDownloadService extends Service {
SharedPreferences localPrefs = getSharedPreferences("localprefs", Context.MODE_PRIVATE);
SharedPreferences.Editor editor = localPrefs.edit();
editor.putBoolean("offline_mode_active", true);
editor.commit();
editor.apply();
} else {
Intent intent = new Intent();

View File

@ -159,14 +159,14 @@ public class OfflineFeedsActivity extends OfflineActivity implements OfflineHead
if (true) {
SharedPreferences.Editor editor = m_prefs.edit();
editor.putBoolean("offline_oldest_first", false);
editor.commit();
editor.apply();
}
break;
case 1:
if (true) {
SharedPreferences.Editor editor = m_prefs.edit();
editor.putBoolean("offline_oldest_first", true);
editor.commit();
editor.apply();
}
break;
}

View File

@ -225,7 +225,7 @@ public class OfflineUploadService extends IntentService {
SharedPreferences localPrefs = getSharedPreferences("localprefs", Context.MODE_PRIVATE);
SharedPreferences.Editor editor = localPrefs.edit();
editor.putBoolean("offline_mode_active", false);
editor.commit();
editor.apply();
} else {
Intent intent = new Intent();