diff options
author | H. Lehmann <ByteHamster@users.noreply.github.com> | 2020-10-16 09:27:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-16 09:27:10 +0200 |
commit | 545ac4eda01d196a6d914b298ebf935031d5b680 (patch) | |
tree | 661419213527113b4b0d94f6dbea2019f9f61930 /core | |
parent | 66c85df9cad05f2f946a0ae180cec66a13d0f4c0 (diff) | |
parent | dc7e2bebbb2b1cfa0b43bc89877418f3dd76e3d3 (diff) | |
download | AntennaPod-545ac4eda01d196a6d914b298ebf935031d5b680.zip |
Merge pull request #4529 from ByteHamster/fix-queue-loader-thread
Load queue in background thread
Diffstat (limited to 'core')
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java | 6 |
1 files changed, 5 insertions, 1 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 00d4e2e90..8677ea030 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 @@ -84,6 +84,7 @@ import io.reactivex.Observable; import io.reactivex.Single; import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.disposables.Disposable; +import io.reactivex.schedulers.Schedulers; import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; @@ -315,7 +316,10 @@ public class PlaybackService extends MediaBrowserServiceCompat { } } emitter.onSuccess(queueItems); - }).subscribe(queueItems -> mediaSession.setQueue(queueItems), Throwable::printStackTrace); + }) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(queueItems -> mediaSession.setQueue(queueItems), Throwable::printStackTrace); flavorHelper.initializeMediaPlayer(PlaybackService.this); mediaSession.setActive(true); |