[Android] VideoPlayerActivity: do not start playback from both onCreate and onResume.

Sébastien Toque git at videolan.org
Wed Sep 26 20:20:27 CEST 2012


vlc-ports/android | branch: master | Sébastien Toque <xilasz at gmail.com> | Wed Sep 26 20:18:42 2012 +0200| [e4a29f877a1bff2942bfa43edcff4b09104c2a26] | committer: Sébastien Toque

VideoPlayerActivity: do not start playback from both onCreate and onResume.
onResume is enough.
also no need to use special code when resuming from pause, load() do all the necessary checks.

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

 .../src/org/videolan/vlc/gui/video/VideoPlayerActivity.java    |    8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

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 9f149f3..f00a962 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -299,7 +299,6 @@ public class VideoPlayerActivity extends Activity {
         this.setVolumeControlStream(AudioManager.STREAM_MUSIC);
 
         setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR);
-        load();
     }
 
     @Override
@@ -381,12 +380,7 @@ public class VideoPlayerActivity extends Activity {
     protected void onResume() {
         AudioServiceController.getInstance().bindAudioService(this);
 
-        if (savedIndexPosition >= 0) {
-            mLibVLC.playIndex(savedIndexPosition);
-            Media media = DatabaseManager.getInstance(this).getMedia(this, mLocation);
-            if (media != null && media.getTime() > 0)
-                mLibVLC.setTime(media.getTime());
-        }
+        load();
 
         showOverlay();
 



More information about the Android mailing list