add an activity check at reloading viewpager
This commit is contained in:
parent
a17e0f7a39
commit
8dfa688f7d
1 changed files with 6 additions and 4 deletions
|
@ -147,12 +147,14 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
|||
|
||||
private fun updatePagerItems() {
|
||||
val pagerAdapter = MyPagerAdapter(this, supportFragmentManager, mMedia)
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 && !isDestroyed) {
|
||||
view_pager?.apply {
|
||||
adapter = pagerAdapter
|
||||
currentItem = mPos
|
||||
addOnPageChangeListener(this@ViewPagerActivity)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun displayCopyDialog() {
|
||||
val files = ArrayList<File>()
|
||||
|
|
Loading…
Reference in a new issue