mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-06-05 21:59:17 +02:00
catching an exception at updating viewpager
This commit is contained in:
@@ -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()
|
||||
|
Reference in New Issue
Block a user