diff options
author | H. Lehmann <ByteHamster@users.noreply.github.com> | 2019-09-20 22:06:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-20 22:06:19 +0200 |
commit | ee02dc40fc4982a65aa8fac035dd499bedf13cd2 (patch) | |
tree | c1e30df59023300a867d8debf2816ef18714fbb6 /core/src/main/java | |
parent | f6c827903032056ac1c2a5f481caaf9c7e7fa4f3 (diff) | |
parent | 9a716ba4ac070c502dd85967056a0474e0315fee (diff) | |
download | AntennaPod-ee02dc40fc4982a65aa8fac035dd499bedf13cd2.zip |
Merge pull request #3424 from ByteHamster/preferences-apply
Calling apply() on preferences edit
Diffstat (limited to 'core/src/main/java')
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java | 9 | ||||
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/util/playback/ExternalMedia.java | 2 |
2 files changed, 4 insertions, 7 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java index e479a7711..ace89e40a 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java @@ -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) { diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/playback/ExternalMedia.java b/core/src/main/java/de/danoeh/antennapod/core/util/playback/ExternalMedia.java index 645bae5f3..9b644c3ba 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/playback/ExternalMedia.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/playback/ExternalMedia.java @@ -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 |