Merge pull request #3424 from ByteHamster/preferences-apply
Calling apply() on preferences edit
This commit is contained in:
commit
ee02dc40fc
|
@ -240,7 +240,7 @@ public class MainActivity extends CastEnabledActivity implements NavDrawerActivi
|
|||
|
||||
SharedPreferences.Editor edit = prefs.edit();
|
||||
edit.putBoolean(PREF_IS_FIRST_LAUNCH, false);
|
||||
edit.commit();
|
||||
edit.apply();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -149,7 +149,7 @@ public abstract class EpisodesListFragment extends Fragment {
|
|||
SharedPreferences.Editor editor = prefs.edit();
|
||||
editor.putInt(PREF_SCROLL_POSITION, firstItem);
|
||||
editor.putFloat(PREF_SCROLL_OFFSET, topOffset);
|
||||
editor.commit();
|
||||
editor.apply();
|
||||
}
|
||||
|
||||
private void restoreScrollPosition() {
|
||||
|
@ -162,7 +162,7 @@ public abstract class EpisodesListFragment extends Fragment {
|
|||
SharedPreferences.Editor editor = prefs.edit();
|
||||
editor.putInt(PREF_SCROLL_POSITION, 0);
|
||||
editor.putFloat(PREF_SCROLL_OFFSET, 0.0f);
|
||||
editor.commit();
|
||||
editor.apply();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -223,7 +223,7 @@ public class QueueFragment extends Fragment {
|
|||
SharedPreferences.Editor editor = prefs.edit();
|
||||
editor.putInt(PREF_SCROLL_POSITION, firstItem);
|
||||
editor.putFloat(PREF_SCROLL_OFFSET, topOffset);
|
||||
editor.commit();
|
||||
editor.apply();
|
||||
}
|
||||
|
||||
private void restoreScrollPosition() {
|
||||
|
|
|
@ -46,7 +46,7 @@ public class SPAUtil {
|
|||
|
||||
SharedPreferences.Editor editor = prefs.edit();
|
||||
editor.putBoolean(PREF_HAS_QUERIED_SP_APPS, true);
|
||||
editor.commit();
|
||||
editor.apply();
|
||||
|
||||
return true;
|
||||
} else {
|
||||
|
@ -63,7 +63,7 @@ public class SPAUtil {
|
|||
SharedPreferences.Editor editor = PreferenceManager
|
||||
.getDefaultSharedPreferences(c.getApplicationContext()).edit();
|
||||
editor.putBoolean(PREF_HAS_QUERIED_SP_APPS, false);
|
||||
editor.commit();
|
||||
editor.apply();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1086,7 +1086,7 @@ public class PlaybackService extends MediaBrowserServiceCompat {
|
|||
editor.putInt(
|
||||
PlaybackPreferences.PREF_CURRENT_PLAYER_STATUS, playerStatus);
|
||||
|
||||
editor.commit();
|
||||
editor.apply();
|
||||
}
|
||||
|
||||
private void writePlayerStatusPlaybackPreferences() {
|
||||
|
@ -1095,11 +1095,8 @@ public class PlaybackService extends MediaBrowserServiceCompat {
|
|||
SharedPreferences.Editor editor = PreferenceManager
|
||||
.getDefaultSharedPreferences(getApplicationContext()).edit();
|
||||
int playerStatus = getCurrentPlayerStatusAsInt(mediaPlayer.getPlayerStatus());
|
||||
|
||||
editor.putInt(
|
||||
PlaybackPreferences.PREF_CURRENT_PLAYER_STATUS, playerStatus);
|
||||
|
||||
editor.commit();
|
||||
editor.putInt(PlaybackPreferences.PREF_CURRENT_PLAYER_STATUS, playerStatus);
|
||||
editor.apply();
|
||||
}
|
||||
|
||||
private void sendNotificationBroadcast(int type, int code) {
|
||||
|
|
|
@ -182,7 +182,7 @@ public class ExternalMedia implements Playable {
|
|||
editor.putLong(PREF_LAST_PLAYED_TIME, timestamp);
|
||||
position = newPosition;
|
||||
lastPlayedTime = timestamp;
|
||||
editor.commit();
|
||||
editor.apply();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue