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()
|
super.onResume()
|
||||||
|
|
||||||
if (runOnResume) {
|
if (runOnResume) {
|
||||||
|
/**
|
||||||
|
* FIXME
|
||||||
|
* this is currently also run on back press when multiple MediaFragments have
|
||||||
|
* been open and closed via similar tab
|
||||||
|
*/
|
||||||
|
|
||||||
lifecycleScope.launch {
|
lifecycleScope.launch {
|
||||||
model.updateOnResume()
|
model.updateOnResume()
|
||||||
|
|
||||||
|
|
|
@ -62,8 +62,10 @@ class MediaFragmentEpisodes : Fragment() {
|
||||||
@SuppressLint("NotifyDataSetChanged")
|
@SuppressLint("NotifyDataSetChanged")
|
||||||
fun updateWatchedState() {
|
fun updateWatchedState() {
|
||||||
// model.currentPlayheads is a val mutable map -> notify dataset changed
|
// model.currentPlayheads is a val mutable map -> notify dataset changed
|
||||||
|
if (this::adapterRecEpisodes.isInitialized) {
|
||||||
adapterRecEpisodes.notifyDataSetChanged()
|
adapterRecEpisodes.notifyDataSetChanged()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun showSeasonSelection(v: View) {
|
private fun showSeasonSelection(v: View) {
|
||||||
// TODO replace with Exposed dropdown menu: https://material.io/components/menus/android#exposed-dropdown-menus
|
// TODO replace with Exposed dropdown menu: https://material.io/components/menus/android#exposed-dropdown-menus
|
||||||
|
|
Loading…
Reference in New Issue