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 {
|
dependencies {
|
||||||
implementation 'com.github.SimpleMobileTools:Simple-Commons:5566a9d221'
|
implementation 'com.github.SimpleMobileTools:Simple-Commons:fd08255626'
|
||||||
implementation 'androidx.multidex:multidex:2.0.1'
|
implementation 'androidx.multidex:multidex:2.0.1'
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
|
implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
|
||||||
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
|
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
|
||||||
|
@@ -811,8 +811,13 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
|
|||||||
private fun updateViewPager(dayCode: String? = Formatter.getTodayCode()) {
|
private fun updateViewPager(dayCode: String? = Formatter.getTodayCode()) {
|
||||||
val fragment = getFragmentsHolder()
|
val fragment = getFragmentsHolder()
|
||||||
currentFragments.forEach {
|
currentFragments.forEach {
|
||||||
|
try {
|
||||||
supportFragmentManager.beginTransaction().remove(it).commitNow()
|
supportFragmentManager.beginTransaction().remove(it).commitNow()
|
||||||
|
} catch (ignored: Exception) {
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
currentFragments.clear()
|
currentFragments.clear()
|
||||||
currentFragments.add(fragment)
|
currentFragments.add(fragment)
|
||||||
val bundle = Bundle()
|
val bundle = Bundle()
|
||||||
|
Reference in New Issue
Block a user