[Android] DirectoryView: refresh list after a deletion

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


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

DirectoryView: refresh list after a deletion

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

 .../src/org/videolan/vlc/gui/DirectoryViewFragment.java       |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/DirectoryViewFragment.java b/vlc-android/src/org/videolan/vlc/gui/DirectoryViewFragment.java
index 40960ae..08cf799 100644
--- a/vlc-android/src/org/videolan/vlc/gui/DirectoryViewFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/DirectoryViewFragment.java
@@ -27,6 +27,7 @@ import org.videolan.vlc.AudioServiceController;
 import org.videolan.vlc.LibVLC;
 import org.videolan.vlc.R;
 import org.videolan.vlc.Util;
+import org.videolan.vlc.VlcRunnable;
 import org.videolan.vlc.gui.audio.AudioPlayerActivity;
 import org.videolan.vlc.gui.video.VideoPlayerActivity;
 import org.videolan.vlc.interfaces.ISortable;
@@ -113,7 +114,13 @@ public class DirectoryViewFragment extends SherlockListFragment implements ISort
             audioController.append(tmp);
             return true;
         } else if(id == R.id.directory_view_delete) {
-            AlertDialog alertDialog = CommonDialogs.deleteMedia(getActivity(), mediaLocation, null);
+            AlertDialog alertDialog = CommonDialogs.deleteMedia(getActivity(), mediaLocation,
+                    new VlcRunnable() {
+                        @Override
+                        public void run(Object o) {
+                            refresh();
+                        }
+                    });
             alertDialog.show();
         } else if(id == R.id.directory_view_play_audio) {
             AudioServiceController audioController = AudioServiceController.getInstance();



More information about the Android mailing list