diff options
author | ByteHamster <info@bytehamster.com> | 2019-09-14 20:52:27 +0200 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2019-09-14 20:52:27 +0200 |
commit | 9a716ba4ac070c502dd85967056a0474e0315fee (patch) | |
tree | 4c591dcc52b3948e86ee6fd42788d26fe7229235 /core/src/main/java | |
parent | 4990733477c4f1a9173b8dc8a8d20a1167b821a8 (diff) | |
download | AntennaPod-9a716ba4ac070c502dd85967056a0474e0315fee.zip |
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 |