From e9e9d3b4c79757f8e8a54eb5af66b48a18227b8d Mon Sep 17 00:00:00 2001 From: kunfei Date: Mon, 4 Nov 2019 15:47:15 +0800 Subject: [PATCH] up --- app/src/main/java/io/legado/app/service/AudioPlayService.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/java/io/legado/app/service/AudioPlayService.kt b/app/src/main/java/io/legado/app/service/AudioPlayService.kt index 664e48e19..fdd8f7a58 100644 --- a/app/src/main/java/io/legado/app/service/AudioPlayService.kt +++ b/app/src/main/java/io/legado/app/service/AudioPlayService.kt @@ -87,8 +87,11 @@ class AudioPlayService : BaseService(), override fun onDestroy() { super.onDestroy() isRun = false + handler.removeCallbacks(dsRunnable) + handler.removeCallbacks(mpRunnable) mediaPlayer.release() mediaSessionCompat?.release() + unregisterReceiver(broadcastReceiver) upMediaSessionPlaybackState(PlaybackStateCompat.STATE_STOPPED) postEvent(Bus.AUDIO_STATE, Status.STOP) }