[Android] Main activity: fix a crash on activity starting

Adrien Maglo git at videolan.org
Sat Feb 1 18:05:28 CET 2014


vlc-ports/android | branch: master | Adrien Maglo <magsoft at videolan.org> | Fri Jan 31 10:55:10 2014 +0100| [4d4a8b073c9fb64a0387e7d63eb1925e387ddfea] | committer: Adrien Maglo

Main activity: fix a crash on activity starting

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

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

diff --git a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
index 3c5a690..805a2c6 100644
--- a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
@@ -363,6 +363,8 @@ public class MainActivity extends SherlockFragmentActivity {
          */
         if(current == null || (!current.getTag().equals(mCurrentFragment) && found)) {
             Log.d(TAG, "Reloading displayed fragment");
+            if (secondaryFragments.contains(mCurrentFragment))
+                mCurrentFragment = "video";
             Fragment ff = getFragment(mCurrentFragment);
             FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
             ft.replace(R.id.fragment_placeholder, ff, mCurrentFragment);



More information about the Android mailing list