mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2025-02-21 12:53:12 +01:00
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,10 +147,12 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
||||||
|
|
||||||
private fun updatePagerItems() {
|
private fun updatePagerItems() {
|
||||||
val pagerAdapter = MyPagerAdapter(this, supportFragmentManager, mMedia)
|
val pagerAdapter = MyPagerAdapter(this, supportFragmentManager, mMedia)
|
||||||
view_pager?.apply {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 && !isDestroyed) {
|
||||||
adapter = pagerAdapter
|
view_pager?.apply {
|
||||||
currentItem = mPos
|
adapter = pagerAdapter
|
||||||
addOnPageChangeListener(this@ViewPagerActivity)
|
currentItem = mPos
|
||||||
|
addOnPageChangeListener(this@ViewPagerActivity)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue