From d094886087c046bc79888c47f48833463bf7350a Mon Sep 17 00:00:00 2001 From: Tuan Luong Date: Sun, 13 Jun 2021 12:06:37 +0700 Subject: [PATCH] keep screen on when in fullscreen mode --- .../brentvatne/exoplayer/ExoPlayerFullscreenVideoActivity.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ExoPlayerFullscreenVideoActivity.java b/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ExoPlayerFullscreenVideoActivity.java index d3b87208..09b2cdfd 100644 --- a/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ExoPlayerFullscreenVideoActivity.java +++ b/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ExoPlayerFullscreenVideoActivity.java @@ -4,6 +4,7 @@ import android.content.pm.ActivityInfo; import android.os.Bundle; import android.view.KeyEvent; import android.view.View; +import android.view.WindowManager; import android.widget.ImageView; import androidx.appcompat.app.AppCompatActivity; @@ -24,6 +25,8 @@ public class ExoPlayerFullscreenVideoActivity extends AppCompatActivity implemen @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); + id = getIntent().getIntExtra(EXTRA_ID, -1); String orientation = getIntent().getStringExtra(EXTRA_ORIENTATION); if ("landscape".equals(orientation)) {