From 9fdf5bcd448b685e784db893464fd664d45c6550 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 19 Jun 2016 11:19:41 +0200 Subject: [PATCH] restore the video progress at rotate --- .../gallery/activities/PhotoVideoActivity.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/simplemobiletools/gallery/activities/PhotoVideoActivity.java b/app/src/main/java/com/simplemobiletools/gallery/activities/PhotoVideoActivity.java index 74c78a998..e6b5649bd 100644 --- a/app/src/main/java/com/simplemobiletools/gallery/activities/PhotoVideoActivity.java +++ b/app/src/main/java/com/simplemobiletools/gallery/activities/PhotoVideoActivity.java @@ -40,10 +40,13 @@ public class PhotoVideoActivity extends AppCompatActivity implements ViewPagerFr final Bundle bundle = new Bundle(); final Medium medium = new Medium(mUri.toString(), mIsVideo, 0); bundle.putSerializable(Constants.MEDIUM, medium); - final ViewPagerFragment fragment = (mIsVideo ? new VideoFragment() : new PhotoFragment()); - fragment.setListener(this); - fragment.setArguments(bundle); - getSupportFragmentManager().beginTransaction().replace(R.id.fragment_holder, fragment).commit(); + + if (savedInstanceState == null) { + final ViewPagerFragment fragment = (mIsVideo ? new VideoFragment() : new PhotoFragment()); + fragment.setListener(this); + fragment.setArguments(bundle); + getSupportFragmentManager().beginTransaction().replace(R.id.fragment_holder, fragment).commit(); + } hideSystemUI(); setTitle(Utils.getFilename(mUri.toString())); }