Skip to content

Commit

Permalink
Fix ANR
Browse files Browse the repository at this point in the history
Signed-off-by: enricocid <enrico2588@gmail.com>
  • Loading branch information
enricocid committed Sep 4, 2022
1 parent 342bebf commit cb4340e
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -884,11 +884,7 @@ class MainActivity : AppCompatActivity(), UIControlInterface, MediaControlInterf
private fun preparePlayback(song: Music?) {
if (isMediaPlayerHolder) {
if (::mPlayerService.isInitialized && !mPlayerService.isRunning) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
startForegroundService(mBindingIntent)
} else {
startService(mBindingIntent)
}
startService(mBindingIntent)
}
mMediaPlayerHolder.initMediaPlayer(song, forceReset = false)
}
Expand Down

0 comments on commit cb4340e

Please sign in to comment.