[Android] last media has been remove a long time ago, remove dead code

Sébastien Toque git at videolan.org
Thu Oct 3 20:58:24 CEST 2013


vlc-ports/android | branch: master | Sébastien Toque <xilasz at gmail.com> | Tue Oct  1 20:47:45 2013 +0200| [e34624ea253b7c78423fead4af6a11563181aa9d] | committer: Sébastien Toque

last media has been remove a long time ago, remove dead code

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

 vlc-android/src/org/videolan/vlc/gui/PreferencesActivity.java  |    1 -
 .../src/org/videolan/vlc/gui/video/VideoGridFragment.java      |    8 ++------
 .../src/org/videolan/vlc/gui/video/VideoListAdapter.java       |    2 +-
 .../src/org/videolan/vlc/gui/video/VideoPlayerActivity.java    |    1 -
 4 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/PreferencesActivity.java b/vlc-android/src/org/videolan/vlc/gui/PreferencesActivity.java
index d3b8d72..9f12592 100644
--- a/vlc-android/src/org/videolan/vlc/gui/PreferencesActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/PreferencesActivity.java
@@ -51,7 +51,6 @@ public class PreferencesActivity extends PreferenceActivity implements OnSharedP
     public final static String TAG = "VLC/PreferencesActivity";
 
     public final static String NAME = "VlcSharedPreferences";
-    public final static String LAST_MEDIA = "LastMedia";
     public final static String VIDEO_RESUME_TIME = "VideoResumeTime";
     public final static String VIDEO_SUBTITLE_FILES = "VideoSubtitleFiles";
     public final static int RESULT_RESCAN = RESULT_FIRST_USER + 1;
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
index 7086227..cfa8290 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
@@ -36,7 +36,6 @@ import org.videolan.vlc.Util;
 import org.videolan.vlc.VlcRunnable;
 import org.videolan.vlc.WeakHandler;
 import org.videolan.vlc.gui.CommonDialogs;
-import org.videolan.vlc.gui.PreferencesActivity;
 import org.videolan.vlc.gui.audio.AudioPlayerFragment;
 import org.videolan.vlc.interfaces.ISortable;
 
@@ -47,7 +46,6 @@ import android.content.BroadcastReceiver;
 import android.content.Context;
 import android.content.Intent;
 import android.content.IntentFilter;
-import android.content.SharedPreferences;
 import android.content.res.Configuration;
 import android.os.Build;
 import android.os.Bundle;
@@ -157,11 +155,9 @@ public class VideoGridFragment extends SherlockGridFragment implements ISortable
     @Override
     public void onResume() {
         super.onResume();
-        //Get & highlight the last media
-        SharedPreferences preferences = getActivity().getSharedPreferences(PreferencesActivity.NAME, Context.MODE_PRIVATE);
-        String lastPath = preferences.getString(PreferencesActivity.LAST_MEDIA, null);
+        //Get & set times
         HashMap<String, Long> times = MediaDatabase.getInstance(getActivity()).getVideoTimes(getActivity());
-        mVideoAdapter.setLastMedia(lastPath, times);
+        mVideoAdapter.setTimes(times);
         mVideoAdapter.notifyDataSetChanged();
         updateList();
         mMediaLibrary.addUpdateHandler(mHandler);
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java
index 0282500..c4966c8 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java
@@ -67,7 +67,7 @@ public class VideoListAdapter extends ArrayAdapter<Media>
         }
     }
 
-    public void setLastMedia(String lastMRL, HashMap<String, Long> times) {
+    public void setTimes(HashMap<String, Long> times) {
         // update times
         for (int i = 0; i < getCount(); ++i) {
             Media media = getItem(i);
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
index 3fa59bd..56b9d14 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -372,7 +372,6 @@ public class VideoPlayerActivity extends Activity implements IVideoPlayer {
         // Save position
         if (time >= 0) {
             if(MediaDatabase.getInstance(this).mediaItemExists(mLocation)) {
-                editor.putString(PreferencesActivity.LAST_MEDIA, mLocation);
                 MediaDatabase.getInstance(this).updateMedia(
                         mLocation,
                         MediaDatabase.mediaColumn.MEDIA_TIME,



More information about the Android mailing list