[Android] Prevent screen form turning off when ask for resume is enabled

Alexandre Perraud git at videolan.org
Mon May 4 17:50:01 CEST 2015


vlc-ports/android | branch: master | Alexandre Perraud <4leyx4ndre at gmail.com> | Mon May  4 17:45:54 2015 +0200| [02605d9e3b5245d42c99d78de148ab77b9f5d6f3] | committer: Alexandre Perraud

Prevent screen form turning off when ask for resume is enabled

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

 .../src/org/videolan/vlc/gui/video/VideoPlayerActivity.java       |    5 +++--
 1 file changed, 3 insertions(+), 2 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 de7b7ed..74e243d 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -699,13 +699,13 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVideoPlay
             mediaRouterAddCallback(true);
         }
 
-        mSurfaceView.setKeepScreenOn(true);
-
         final EventHandler em = EventHandler.getInstance();
         em.addHandler(mEventHandler);
 
         loadMedia();
 
+        mSurfaceView.setKeepScreenOn(true);
+
         // Add any selected subtitle file from the file picker
         if(mSubtitleSelectedFiles.size() > 0) {
             for(String file : mSubtitleSelectedFiles) {
@@ -2941,6 +2941,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVideoPlay
                     }
                 })
                 .create();
+        mAlertDialog.setCancelable(false);
         mAlertDialog.show();
     }
 



More information about the Android mailing list