lint: use preferenceeditor.apply instead of commit
This commit is contained in:
parent
75b86b94bb
commit
3d23124f72
@ -80,7 +80,7 @@ public class CommonActivity extends ActionBarActivity {
|
|||||||
public void setUnreadOnly(boolean unread) {
|
public void setUnreadOnly(boolean unread) {
|
||||||
SharedPreferences.Editor editor = m_prefs.edit();
|
SharedPreferences.Editor editor = m_prefs.edit();
|
||||||
editor.putBoolean("show_unread_only", unread);
|
editor.putBoolean("show_unread_only", unread);
|
||||||
editor.commit();
|
editor.apply();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void toast(int msgId) {
|
public void toast(int msgId) {
|
||||||
|
@ -97,7 +97,7 @@ public class FeedsActivity extends OnlineActivity implements HeadlinesEventListe
|
|||||||
if (m_prefs.getBoolean("drawer_open_on_start", true)) {
|
if (m_prefs.getBoolean("drawer_open_on_start", true)) {
|
||||||
SharedPreferences.Editor editor = m_prefs.edit();
|
SharedPreferences.Editor editor = m_prefs.edit();
|
||||||
editor.putBoolean("drawer_open_on_start", false);
|
editor.putBoolean("drawer_open_on_start", false);
|
||||||
editor.commit();
|
editor.apply();
|
||||||
}
|
}
|
||||||
|
|
||||||
invalidateOptionsMenu();
|
invalidateOptionsMenu();
|
||||||
|
@ -216,7 +216,7 @@ public class OnlineActivity extends CommonActivity {
|
|||||||
SharedPreferences localPrefs = getSharedPreferences("localprefs", Context.MODE_PRIVATE);
|
SharedPreferences localPrefs = getSharedPreferences("localprefs", Context.MODE_PRIVATE);
|
||||||
SharedPreferences.Editor editor = localPrefs.edit();
|
SharedPreferences.Editor editor = localPrefs.edit();
|
||||||
editor.putBoolean("offline_mode_active", true);
|
editor.putBoolean("offline_mode_active", true);
|
||||||
editor.commit();
|
editor.apply();
|
||||||
|
|
||||||
Intent offline = new Intent(
|
Intent offline = new Intent(
|
||||||
OnlineActivity.this,
|
OnlineActivity.this,
|
||||||
@ -388,7 +388,7 @@ public class OnlineActivity extends CommonActivity {
|
|||||||
|
|
||||||
SharedPreferences.Editor editor = m_prefs.edit();
|
SharedPreferences.Editor editor = m_prefs.edit();
|
||||||
editor.putBoolean("offline_mode_active", true);
|
editor.putBoolean("offline_mode_active", true);
|
||||||
editor.commit();
|
editor.apply();
|
||||||
|
|
||||||
Intent offline = new Intent(OnlineActivity.this, OfflineActivity.class);
|
Intent offline = new Intent(OnlineActivity.this, OfflineActivity.class);
|
||||||
offline.putExtra("initial", true);
|
offline.putExtra("initial", true);
|
||||||
@ -483,7 +483,7 @@ public class OnlineActivity extends CommonActivity {
|
|||||||
|
|
||||||
SharedPreferences.Editor editor = m_prefs.edit();
|
SharedPreferences.Editor editor = m_prefs.edit();
|
||||||
editor.putLong("date_firstlaunch_trial", firstStart);
|
editor.putLong("date_firstlaunch_trial", firstStart);
|
||||||
editor.commit();
|
editor.apply();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!notify && System.currentTimeMillis() > firstStart + (TRIAL_DAYS * 24 * 60 * 60 * 1000)) {
|
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) {
|
public void setSortMode(String sortMode) {
|
||||||
SharedPreferences.Editor editor = m_prefs.edit();
|
SharedPreferences.Editor editor = m_prefs.edit();
|
||||||
editor.putString("headlines_sort_mode", sortMode);
|
editor.putString("headlines_sort_mode", sortMode);
|
||||||
editor.commit();
|
editor.apply();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setViewMode(String viewMode) {
|
public void setViewMode(String viewMode) {
|
||||||
SharedPreferences.Editor editor = m_prefs.edit();
|
SharedPreferences.Editor editor = m_prefs.edit();
|
||||||
editor.putString("view_mode", viewMode);
|
editor.putString("view_mode", viewMode);
|
||||||
editor.commit();
|
editor.apply();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getViewMode() {
|
public String getViewMode() {
|
||||||
|
@ -606,7 +606,7 @@ public class OfflineActivity extends CommonActivity {
|
|||||||
SharedPreferences localPrefs = getSharedPreferences("localprefs", Context.MODE_PRIVATE);
|
SharedPreferences localPrefs = getSharedPreferences("localprefs", Context.MODE_PRIVATE);
|
||||||
SharedPreferences.Editor editor = localPrefs.edit();
|
SharedPreferences.Editor editor = localPrefs.edit();
|
||||||
editor.putBoolean("offline_mode_active", false);
|
editor.putBoolean("offline_mode_active", false);
|
||||||
editor.commit();
|
editor.apply();
|
||||||
|
|
||||||
Intent refresh = new Intent(this, org.fox.ttrss.OnlineActivity.class);
|
Intent refresh = new Intent(this, org.fox.ttrss.OnlineActivity.class);
|
||||||
startActivity(refresh);
|
startActivity(refresh);
|
||||||
@ -808,7 +808,7 @@ public class OfflineActivity extends CommonActivity {
|
|||||||
public void setViewMode(String viewMode) {
|
public void setViewMode(String viewMode) {
|
||||||
SharedPreferences.Editor editor = m_prefs.edit();
|
SharedPreferences.Editor editor = m_prefs.edit();
|
||||||
editor.putString("offline_view_mode", viewMode);
|
editor.putString("offline_view_mode", viewMode);
|
||||||
editor.commit();
|
editor.apply();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* public boolean getOldestFirst() {
|
/* public boolean getOldestFirst() {
|
||||||
|
@ -161,7 +161,7 @@ public class OfflineDownloadService extends Service {
|
|||||||
SharedPreferences localPrefs = getSharedPreferences("localprefs", Context.MODE_PRIVATE);
|
SharedPreferences localPrefs = getSharedPreferences("localprefs", Context.MODE_PRIVATE);
|
||||||
SharedPreferences.Editor editor = localPrefs.edit();
|
SharedPreferences.Editor editor = localPrefs.edit();
|
||||||
editor.putBoolean("offline_mode_active", true);
|
editor.putBoolean("offline_mode_active", true);
|
||||||
editor.commit();
|
editor.apply();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Intent intent = new Intent();
|
Intent intent = new Intent();
|
||||||
|
@ -159,14 +159,14 @@ public class OfflineFeedsActivity extends OfflineActivity implements OfflineHead
|
|||||||
if (true) {
|
if (true) {
|
||||||
SharedPreferences.Editor editor = m_prefs.edit();
|
SharedPreferences.Editor editor = m_prefs.edit();
|
||||||
editor.putBoolean("offline_oldest_first", false);
|
editor.putBoolean("offline_oldest_first", false);
|
||||||
editor.commit();
|
editor.apply();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
if (true) {
|
if (true) {
|
||||||
SharedPreferences.Editor editor = m_prefs.edit();
|
SharedPreferences.Editor editor = m_prefs.edit();
|
||||||
editor.putBoolean("offline_oldest_first", true);
|
editor.putBoolean("offline_oldest_first", true);
|
||||||
editor.commit();
|
editor.apply();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -225,7 +225,7 @@ public class OfflineUploadService extends IntentService {
|
|||||||
SharedPreferences localPrefs = getSharedPreferences("localprefs", Context.MODE_PRIVATE);
|
SharedPreferences localPrefs = getSharedPreferences("localprefs", Context.MODE_PRIVATE);
|
||||||
SharedPreferences.Editor editor = localPrefs.edit();
|
SharedPreferences.Editor editor = localPrefs.edit();
|
||||||
editor.putBoolean("offline_mode_active", false);
|
editor.putBoolean("offline_mode_active", false);
|
||||||
editor.commit();
|
editor.apply();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Intent intent = new Intent();
|
Intent intent = new Intent();
|
||||||
|
Loading…
Reference in New Issue
Block a user