Android Question Help:keepScreenOn doesn't work when video is playing

teddybear

Well-Known Member
Licensed User
Hi, I wrote a video player with exoplayer library, it is always locked screen when playing .I have set WAKE_LOCK & keepScreenOn in the manifest file. but it doesn't work.
following is my manifest
manifest:
AddPermission(android.permission.WAKE_LOCK)
SetActivityAttribute(Main, android:keepScreenOn, "true")
'End of default text.
My goal is to keep the screen on when video is playing.
Thanks
 

teddybear

Well-Known Member
Licensed User
Acquire a wake lock with PhoneWakeState from the phone library.
Thank you a lot. It works well.
I am a newbie, another question for ask, I do ReleaseKeepAlive in Activity_Pause, in Activity_Resume do I have to call KeepAlive(True)?
 
Upvote 0

teddybear

Well-Known Member
Licensed User
Go on the thread, the app it works well on my phone, so I installed it on my TV, the screen saver would be popped while video is playing, I don't how to disable it.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…