[Android] Go back on login fail

Geoffrey Métais git at videolan.org
Mon Mar 7 16:35:49 CET 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Mar  7 16:29:54 2016 +0100| [74b71be959b2e01b4f87d36c6d08aa3b3296cf14] | committer: Geoffrey Métais

Go back on login fail

> https://code.videolan.org/videolan/vlc-android/commit/74b71be959b2e01b4f87d36c6d08aa3b3296cf14
---

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

diff --git a/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java b/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java
index ac5f4af..33f57dd 100644
--- a/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java
@@ -88,6 +88,7 @@ public abstract class BaseBrowserFragment extends MediaBrowserFragment implement
     protected MediaWrapper mCurrentMedia;
     protected int mSavedPosition = -1, mFavorites = 0;
     public boolean mRoot;
+    boolean goBack = false;
 
     private SparseArray<ArrayList<MediaWrapper>> mFoldersContentLists;
     private ArrayList<MediaWrapper> mediaList;
@@ -148,6 +149,13 @@ public abstract class BaseBrowserFragment extends MediaBrowserFragment implement
         return v;
     }
 
+    @Override
+    public void onResume() {
+        super.onResume();
+        if (goBack)
+            goBack();
+    }
+
     public void onStop(){
         super.onStop();
         releaseBrowser();
@@ -235,6 +243,8 @@ public abstract class BaseBrowserFragment extends MediaBrowserFragment implement
         mHandler.sendEmptyMessage(BrowserFragmentHandler.MSG_HIDE_LOADING);
         if (mReadyToDisplay)
             display();
+        if (!isResumed())
+            goBack = true;
     }
 
     @Override



More information about the Android mailing list