fix (workaround) a crash in MediaFragment if one opens and closes multiple new MediaFragment via the similar tab
This commit is contained in:
parent
7abb5cd3e8
commit
aa49169034
|
@ -78,6 +78,12 @@ class MediaFragment(private val mediaIdStr: String) : Fragment() {
|
|||
super.onResume()
|
||||
|
||||
if (runOnResume) {
|
||||
/**
|
||||
* FIXME
|
||||
* this is currently also run on back press when multiple MediaFragments have
|
||||
* been open and closed via similar tab
|
||||
*/
|
||||
|
||||
lifecycleScope.launch {
|
||||
model.updateOnResume()
|
||||
|
||||
|
|
|
@ -62,8 +62,10 @@ class MediaFragmentEpisodes : Fragment() {
|
|||
@SuppressLint("NotifyDataSetChanged")
|
||||
fun updateWatchedState() {
|
||||
// model.currentPlayheads is a val mutable map -> notify dataset changed
|
||||
if (this::adapterRecEpisodes.isInitialized) {
|
||||
adapterRecEpisodes.notifyDataSetChanged()
|
||||
}
|
||||
}
|
||||
|
||||
private fun showSeasonSelection(v: View) {
|
||||
// TODO replace with Exposed dropdown menu: https://material.io/components/menus/android#exposed-dropdown-menus
|
||||
|
|
Loading…
Reference in New Issue