mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-06-05 21:59:17 +02:00
avoid trying to refresh viewpager from wrong thread, or with invalid activity
This commit is contained in:
@@ -557,7 +557,11 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun refreshViewPager() {
|
private fun refreshViewPager() {
|
||||||
currentFragments.last().refreshEvents()
|
if (!isActivityDestroyed()) {
|
||||||
|
runOnUiThread {
|
||||||
|
currentFragments.last().refreshEvents()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun tryImportEvents() {
|
private fun tryImportEvents() {
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
package com.simplemobiletools.calendar.fragments
|
package com.simplemobiletools.calendar.fragments
|
||||||
|
|
||||||
import android.support.v4.app.Fragment
|
import android.support.v4.app.Fragment
|
||||||
import org.joda.time.DateTime
|
|
||||||
|
|
||||||
abstract class MyFragmentHolder : Fragment() {
|
abstract class MyFragmentHolder : Fragment() {
|
||||||
abstract fun goToToday()
|
abstract fun goToToday()
|
||||||
|
Reference in New Issue
Block a user