[Android] Fix refresh after deletion from MediaInfoFragment

Geoffrey Métais git at videolan.org
Tue Jan 5 18:37:04 CET 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Jan  5 18:34:36 2016 +0100| [4177c2abe4f55d4e5f60846ede75215aa7fca359] | committer: Geoffrey Métais

Fix refresh after deletion from MediaInfoFragment

> https://code.videolan.org/videolan/vlc-android/commit/4177c2abe4f55d4e5f60846ede75215aa7fca359
---

 vlc-android/src/org/videolan/vlc/gui/MainActivity.java                | 4 ++--
 vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java | 2 +-
 2 files changed, 3 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 202eb1a..c3e4d84 100644
--- a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
@@ -100,7 +100,7 @@ public class MainActivity extends AudioPlayerContainerActivity implements Search
 
     private static final int ACTIVITY_RESULT_PREFERENCES = 1;
     private static final int ACTIVITY_RESULT_OPEN = 2;
-    private static final int ACTIVITY_RESULT_SECONDARY = 3;
+    public static final int ACTIVITY_RESULT_SECONDARY = 3;
     private static final int ACTIVITY_SHOW_INFOLAYOUT = 2;
     private static final int ACTIVITY_SHOW_PROGRESSBAR = 3;
     private static final int ACTIVITY_HIDE_PROGRESSBAR = 4;
@@ -663,7 +663,7 @@ public class MainActivity extends AudioPlayerContainerActivity implements Search
             MediaUtils.openUri(this, data.getData());
         } else if (requestCode == ACTIVITY_RESULT_SECONDARY) {
             if (resultCode == PreferencesActivity.RESULT_RESCAN) {
-                mMediaLibrary.scanMediaItems(true);
+                forceRefresh(getSupportFragmentManager().findFragmentById(R.id.fragment_placeholder));
             }
         }
     }
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 ed0b18f..987d9dd 100644
--- a/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java
@@ -437,7 +437,7 @@ public abstract class BaseBrowserFragment extends MediaBrowserFragment implement
                 Intent i = new Intent(getActivity(), SecondaryActivity.class);
                 i.putExtra("fragment", "mediaInfo");
                 i.putExtra("param", mw.getUri().toString());
-                startActivity(i);
+                getActivity().startActivityForResult(i, MainActivity.ACTIVITY_RESULT_SECONDARY);
                 return true;
             case R.id.directory_view_play_audio: {
                 if (mService != null) {



More information about the Android mailing list