开发者

screen goes off while recording and preview gets corrupted

开发者 https://www.devze.com 2023-01-07 02:58 出处:网络
How do you prevent the screen from going off when recording is in process. If recording is in process, and there\'s no other activity like using arrow keys, or the keypad, the scree开发者_StackOverflo

How do you prevent the screen from going off when recording is in process. If recording is in process, and there's no other activity like using arrow keys, or the keypad, the scree开发者_StackOverflown goes off and when it's brought back to life, the preview is corrupted.


What do you mean with "recording in progress"? You have an app that is recording something? The easiest way (which doesn't require any additional permissions) is to give any of your views android:keepScreenOn=true (there's also setKeepScreenOn()).

If you want to be hardcore, you can request a wakelock permission, but that should not be necessary - if you have a UI, keepScreenOn is a much more elegant solution.

0

精彩评论

暂无评论...
验证码 换一张
取 消