[Android] Main activity: do not show the new fragment if the requested fragment is already shown

Adrien Maglo git at videolan.org
Wed Jan 29 11:05:27 CET 2014


vlc-ports/android | branch: master | Adrien Maglo <magsoft at videolan.org> | Wed Jan 29 11:05:21 2014 +0100| [ad87225b2b3e24f0f473c3081749977980ac6b2b] | committer: Adrien Maglo

Main activity: do not show the new fragment if the requested fragment is already shown

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

 vlc-android/src/org/videolan/vlc/gui/MainActivity.java |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
index f9d5b9f..e4a0523 100644
--- a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
@@ -470,6 +470,10 @@ public class MainActivity extends SherlockFragmentActivity {
         // Slide down the mini player if needed.
         slideDownMiniPlayer();
 
+        // Do not show the new fragment if the requested fragment is already shown.
+        if (mCurrentFragment.equals(fragmentTag))
+            return null;
+
         mPreviousFragment = mCurrentFragment;
         mCurrentFragment = fragmentTag;
         Fragment frag = getFragment(mCurrentFragment);



More information about the Android mailing list