Fixed blocking issue when leaving MainActivity where playback state would no longer be reflected in Now Playing.

This commit is contained in:
Antoine POPINEAU 2020-06-21 16:15:52 +02:00
parent 671940ed7a
commit 874b79d0d5
No known key found for this signature in database
GPG Key ID: A78AC64694F84063
1 changed files with 5 additions and 7 deletions

View File

@ -73,16 +73,16 @@ class MainActivity : AppCompatActivity() {
.replace(R.id.container, BrowseFragment())
.commit()
if (bus == null) {
watchEventBus()
}
CommandBus.send(Command.RefreshService)
}
override fun onResume() {
super.onResume()
if (bus == null) {
watchEventBus()
}
CommandBus.send(Command.RefreshService)
startService(Intent(this, PlayerService::class.java))
@ -150,9 +150,7 @@ class MainActivity : AppCompatActivity() {
// CastButtonFactory.setUpMediaRouteButton(this, menu, R.id.cast)
menu?.let {
menu.findItem(R.id.nav_only_my_music).isChecked = Settings.getScope() == "me"
}
menu?.findItem(R.id.nav_only_my_music)?.isChecked = Settings.getScope() == "me"
return true
}