avoid trying to refresh viewpager from wrong thread, or with invalid activity
This commit is contained in:
parent
e04b84c416
commit
fbd37d4977
|
@ -557,7 +557,11 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
|
|||
}
|
||||
|
||||
private fun refreshViewPager() {
|
||||
currentFragments.last().refreshEvents()
|
||||
if (!isActivityDestroyed()) {
|
||||
runOnUiThread {
|
||||
currentFragments.last().refreshEvents()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun tryImportEvents() {
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package com.simplemobiletools.calendar.fragments
|
||||
|
||||
import android.support.v4.app.Fragment
|
||||
import org.joda.time.DateTime
|
||||
|
||||
abstract class MyFragmentHolder : Fragment() {
|
||||
abstract fun goToToday()
|
||||
|
|
Loading…
Reference in New Issue