From 6af43c0b81a065147c6a7347723059eddf97340a Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 25 Apr 2016 19:56:04 +0200 Subject: [PATCH] use the local variable for getting current page index --- .../gallery/activities/ViewPagerActivity.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/simplemobiletools/gallery/activities/ViewPagerActivity.java b/app/src/main/java/com/simplemobiletools/gallery/activities/ViewPagerActivity.java index e7620e4cc..f0b850697 100644 --- a/app/src/main/java/com/simplemobiletools/gallery/activities/ViewPagerActivity.java +++ b/app/src/main/java/com/simplemobiletools/gallery/activities/ViewPagerActivity.java @@ -304,7 +304,7 @@ public class ViewPagerActivity extends AppCompatActivity } private File getCurrentFile() { - return new File(photos.get(pager.getCurrentItem())); + return new File(photos.get(pos)); } private void addUndoBottomMargin() { @@ -326,6 +326,7 @@ public class ViewPagerActivity extends AppCompatActivity @Override public void onPageSelected(int position) { updateActionbarTitle(); + pos = position; } @Override