refetch viewpager item position if it is -1 too

This commit is contained in:
tibbi 2022-03-01 12:08:15 +01:00
parent 61440e2f22
commit 360c3529ea

View file

@ -1192,7 +1192,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
mPrevHashcode = media.hashCode()
mMediaFiles = media
if (refetchViewPagerPosition) {
if (refetchViewPagerPosition || mPos == -1) {
mPos = getPositionInList(media)
if (mPos == -1) {
Math.min(mPos, mMediaFiles.size - 1)