[Android] Fix rotation for video group view

Geoffrey Métais git at videolan.org
Mon Apr 27 15:04:33 CEST 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Apr 27 12:07:46 2015 +0200| [f15791475f52ef530dd4c41bad75f085d66a6c88] | committer: Geoffrey Métais

Fix rotation for video group view

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=f15791475f52ef530dd4c41bad75f085d66a6c88
---

 .../src/org/videolan/vlc/gui/video/VideoGridFragment.java    |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
index d7c2921..e6bf65e 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
@@ -83,6 +83,8 @@ public class VideoGridFragment extends MediaBrowserFragment implements ISortable
 
     public final static String TAG = "VLC/VideoListFragment";
 
+    public final static String KEY_GROUP = "key_group";
+
     protected static final String ACTION_SCAN_START = "org.videolan.vlc.gui.ScanStart";
     protected static final String ACTION_SCAN_STOP = "org.videolan.vlc.gui.ScanStop";
     protected static final int UPDATE_ITEM = 0;
@@ -123,6 +125,8 @@ public class VideoGridFragment extends MediaBrowserFragment implements ISortable
         mVideoAdapter = new VideoListAdapter(getActivity(), this);
         mMediaLibrary = MediaLibrary.getInstance();
 
+        if (savedInstanceState != null)
+            setGroup(savedInstanceState.getString(KEY_GROUP));
         /* Load the thumbnailer */
         FragmentActivity activity = getActivity();
         if (activity != null)
@@ -218,6 +222,12 @@ public class VideoGridFragment extends MediaBrowserFragment implements ISortable
     }
 
     @Override
+    public void onSaveInstanceState(Bundle outState) {
+        super.onSaveInstanceState(outState);
+        outState.putString(KEY_GROUP, mGroup);
+    }
+
+    @Override
     public void onDestroyView() {
         getActivity().unregisterReceiver(messageReceiverVideoListFragment);
         super.onDestroyView();



More information about the Android mailing list