catching an exception at updating viewpager
This commit is contained in:
parent
5f781cafe3
commit
f7ee3feaec
|
@ -63,7 +63,7 @@ android {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'com.github.SimpleMobileTools:Simple-Commons:5566a9d221'
|
||||
implementation 'com.github.SimpleMobileTools:Simple-Commons:fd08255626'
|
||||
implementation 'androidx.multidex:multidex:2.0.1'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
|
||||
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
|
||||
|
|
|
@ -811,8 +811,13 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
|
|||
private fun updateViewPager(dayCode: String? = Formatter.getTodayCode()) {
|
||||
val fragment = getFragmentsHolder()
|
||||
currentFragments.forEach {
|
||||
supportFragmentManager.beginTransaction().remove(it).commitNow()
|
||||
try {
|
||||
supportFragmentManager.beginTransaction().remove(it).commitNow()
|
||||
} catch (ignored: Exception) {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
currentFragments.clear()
|
||||
currentFragments.add(fragment)
|
||||
val bundle = Bundle()
|
||||
|
|
Loading…
Reference in New Issue