avoid trying to refresh viewpager from wrong thread, or with invalid activity
This commit is contained in:
parent
e04b84c416
commit
fbd37d4977
|
@ -557,8 +557,12 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun refreshViewPager() {
|
private fun refreshViewPager() {
|
||||||
|
if (!isActivityDestroyed()) {
|
||||||
|
runOnUiThread {
|
||||||
currentFragments.last().refreshEvents()
|
currentFragments.last().refreshEvents()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun tryImportEvents() {
|
private fun tryImportEvents() {
|
||||||
handlePermission(PERMISSION_READ_STORAGE) {
|
handlePermission(PERMISSION_READ_STORAGE) {
|
||||||
|
|
|
@ -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()
|
||||||
|
|
Loading…
Reference in New Issue