mirror of
https://github.com/cmclark00/RetroMusicPlayer.git
synced 2025-05-20 00:55:20 +01:00
Fixed MainActivity restart when opening activity from notification & widget
This commit is contained in:
parent
367718fadd
commit
56100cab0a
4 changed files with 13 additions and 10 deletions
|
@ -129,15 +129,15 @@ class MainActivity : AbsCastActivity(), OnSharedPreferenceChangeListener {
|
|||
override fun onSupportNavigateUp(): Boolean =
|
||||
findNavController(R.id.fragment_container).navigateUp()
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
override fun onNewIntent(intent: Intent?) {
|
||||
super.onNewIntent(intent)
|
||||
PreferenceUtil.registerOnSharedPreferenceChangedListener(this)
|
||||
val expand = extra<Boolean>(EXPAND_PANEL).value ?: false
|
||||
val expand = intent?.extra<Boolean>(EXPAND_PANEL)?.value ?: false
|
||||
if (expand && PreferenceUtil.isExpandPanel) {
|
||||
fromNotification = true
|
||||
slidingPanel.bringToFront()
|
||||
expandPanel()
|
||||
intent.removeExtra(EXPAND_PANEL)
|
||||
intent?.removeExtra(EXPAND_PANEL)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue