Merge pull request #1347 from Bnyro/master

fix accidential app closure
This commit is contained in:
Bnyro 2022-09-22 19:08:55 +02:00 committed by GitHub
commit 7c8b1bb826
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 3 deletions

View File

@ -7,7 +7,6 @@ import android.os.Build
import android.os.Bundle import android.os.Bundle
import android.os.Handler import android.os.Handler
import android.os.Looper import android.os.Looper
import android.util.Log
import android.view.Menu import android.view.Menu
import android.view.MenuItem import android.view.MenuItem
import android.view.View import android.view.View

View File

@ -1026,9 +1026,9 @@ class PlayerFragment : BaseFragment() {
} }
// listen for the stop button in the notification // listen for the stop button in the notification
if (playbackState == PlaybackState.STATE_STOPPED) { if (playbackState == PlaybackState.STATE_STOPPED && SDK_INT >= Build.VERSION_CODES.O) {
// finish PiP by finishing the activity // finish PiP by finishing the activity
activity?.finish() if (activity?.isInPictureInPictureMode!!) activity?.finish()
} }
super.onPlaybackStateChanged(playbackState) super.onPlaybackStateChanged(playbackState)
} }