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,8 +557,12 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
|
||||
}
|
||||
|
||||
private fun refreshViewPager() {
|
||||
if (!isActivityDestroyed()) {
|
||||
runOnUiThread {
|
||||
currentFragments.last().refreshEvents()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun tryImportEvents() {
|
||||
handlePermission(PERMISSION_READ_STORAGE) {
|
||||
|
@@ -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()
|
||||
|
Reference in New Issue
Block a user