I have developed a video player application. The app will keep playing videos (and repeat them). I want to handle it while its playing so I need the videos to be playing all the time but the android system makes the screen black automatically, lock the screen or put the system on sleep. I want to know how to avoid this from happen, i.e., my program should keep playing the video and the screen shouldn’t turn black. I have found some solutions on the Internet but still its not working, thanks for your help.
I have developed a video player application. The app will keep playing videos (and
Share
Try using:
or just:
EDIT:
according to this link : How do I prevent an Android device from going to sleep programmatically?. You should use:
You also need to be sure you have the WAKE_LOCK permission set in your Manifest.