[Android] DirectoryView: fix refresh from MainActivity

Sébastien Toque git at videolan.org
Wed Aug 22 19:01:48 CEST 2012


vlc-ports/android | branch: master | Sébastien Toque <xilasz at gmail.com> | Wed Aug 22 16:41:48 2012 +0200| [5b4e5c6fac37183f583c184354fbb1551345e4ae] | committer: Sébastien Toque

DirectoryView: fix refresh from MainActivity

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

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

diff --git a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
index 0dc2072..3e337a1 100644
--- a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
@@ -92,7 +92,6 @@ public class MainActivity extends SherlockFragmentActivity {
     private View mInfoLayout;
     private ProgressBar mInfoProgress;
     private TextView mInfoText;
-    private DirectoryViewFragment mDirectoryView;
     private String mCurrentFragment;
 
     private SharedPreferences mSettings;
@@ -345,8 +344,10 @@ public class MainActivity extends SherlockFragmentActivity {
             // Refresh
             case R.id.ml_menu_refresh:
                 // TODO: factor this into each fragment
-                if(mCurrentFragment.equals("directories"))
-                    mDirectoryView.refresh();
+                if(mCurrentFragment.equals("directories")) {
+                    DirectoryViewFragment directoryView = (DirectoryViewFragment) mSidebarAdapter.getFragment(mCurrentFragment);
+                    directoryView.refresh();
+                }
                 else
                     MediaLibrary.getInstance(this).loadMediaItems(this);
                 break;



More information about the Android mailing list