Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BackGround Music Player Problem Fixed #1635

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/src/main/java/code/name/monkey/retromusic/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package code.name.monkey.retromusic

import android.app.Application
import androidx.preference.PreferenceManager
import androidx.viewbinding.BuildConfig
import cat.ereza.customactivityoncrash.config.CaocConfig
import code.name.monkey.appthemehelper.ThemeStore
import code.name.monkey.appthemehelper.util.VersionUtils
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ class MainActivity : AbsCastActivity() {
findNavController(R.id.fragment_container).navigateUp()

override fun onNewIntent(intent: Intent?) {

super.onNewIntent(intent)
val expand = intent?.extra<Boolean>(EXPAND_PANEL)?.value ?: false
if (expand && PreferenceUtil.isExpandPanel) {
Expand Down Expand Up @@ -194,6 +195,11 @@ class MainActivity : AbsCastActivity() {
}
}
}
override fun onStop() {
super.onStop()
// Stop the music playback when the activity is stopped
MusicPlayerRemote.pauseSong()
}

private fun parseLongFromIntent(
intent: Intent,
Expand Down