Browse Source

fix (workaround) a crash in MediaFragment if one opens and closes multiple new MediaFragment via the similar tab

develop
Jannik 3 months ago
parent
commit
aa49169034
Signed by: Seil0
GPG Key ID: E8459F3723C52C24
  1. 6
      app/src/main/java/org/mosad/teapod/ui/activity/main/fragments/MediaFragment.kt
  2. 4
      app/src/main/java/org/mosad/teapod/ui/activity/main/fragments/MediaFragmentEpisodes.kt

6
app/src/main/java/org/mosad/teapod/ui/activity/main/fragments/MediaFragment.kt

@ -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()

4
app/src/main/java/org/mosad/teapod/ui/activity/main/fragments/MediaFragmentEpisodes.kt

@ -62,7 +62,9 @@ class MediaFragmentEpisodes : Fragment() {
@SuppressLint("NotifyDataSetChanged")
fun updateWatchedState() {
// model.currentPlayheads is a val mutable map -> notify dataset changed
adapterRecEpisodes.notifyDataSetChanged()
if (this::adapterRecEpisodes.isInitialized) {
adapterRecEpisodes.notifyDataSetChanged()
}
}
private fun showSeasonSelection(v: View) {

Loading…
Cancel
Save

Du besuchst diese Seite mit einem veralteten IPv4-Internetzugang. Möglicherweise treten in Zukunft Probleme mit der Erreichbarkeit und Performance auf. Bitte frage deinen Internetanbieter oder Netzwerkadministrator nach IPv6-Unterstützung.
You are visiting this site with an outdated IPv4 internet access. You may experience problems with accessibility and performance in the future. Please ask your ISP or network administrator for IPv6 support.
Weitere Infos | More Information
Klicke zum schließen | Click to close