I refer to the following sample code:
How do I prevent screen timeout
I am using ExoPlayer library. When the video plays until 2 minutes, the screen turns dim and then screen lock.
I have tried to add the permission in manifest but the screen still sleep.
Method 1:
Method 2:
I am using Xiaomi Redmi 5 Plus (Android 7.1.2). Is there any setting I need to change in my phone?
How do I prevent screen timeout
I am using ExoPlayer library. When the video plays until 2 minutes, the screen turns dim and then screen lock.
I have tried to add the permission in manifest but the screen still sleep.
Method 1:
B4X:
AddPermission(android.permission.WAKE_LOCK)
Method 2:
B4X:
AddManifestText(<uses-permission android:name="android.permission.WAKE_LOCK" />)
I am using Xiaomi Redmi 5 Plus (Android 7.1.2). Is there any setting I need to change in my phone?