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 f0b850697..27775722e 100644 --- a/app/src/main/java/com/simplemobiletools/gallery/activities/ViewPagerActivity.java +++ b/app/src/main/java/com/simplemobiletools/gallery/activities/ViewPagerActivity.java @@ -66,8 +66,7 @@ public class ViewPagerActivity extends AppCompatActivity if (isDirEmpty()) return; - final MyPagerAdapter adapter = new MyPagerAdapter(getSupportFragmentManager()); - adapter.setPaths(photos); + final MyPagerAdapter adapter = new MyPagerAdapter(getSupportFragmentManager(), photos); pager.setAdapter(adapter); pager.setCurrentItem(pos); pager.addOnPageChangeListener(this); diff --git a/app/src/main/java/com/simplemobiletools/gallery/adapters/MyPagerAdapter.java b/app/src/main/java/com/simplemobiletools/gallery/adapters/MyPagerAdapter.java index 03c6cdab8..c56fe564c 100644 --- a/app/src/main/java/com/simplemobiletools/gallery/adapters/MyPagerAdapter.java +++ b/app/src/main/java/com/simplemobiletools/gallery/adapters/MyPagerAdapter.java @@ -11,11 +11,8 @@ import java.util.List; public class MyPagerAdapter extends FragmentStatePagerAdapter { private List paths; - public MyPagerAdapter(FragmentManager fm) { + public MyPagerAdapter(FragmentManager fm, List paths) { super(fm); - } - - public void setPaths(List paths) { this.paths = paths; }