开发者

Black screen is displaying in Android

开发者 https://www.devze.com 2022-12-24 01:17 出处:网络
I opened my application after I am not doing any kind of operation. I leave the mobile 5 min. Aft开发者_开发百科er 5 min when I touch the my application it is showing black screen. Is there any way to

I opened my application after I am not doing any kind of operation. I leave the mobile 5 min. Aft开发者_开发百科er 5 min when I touch the my application it is showing black screen. Is there any way to avoid this idle state?


This is easy to do. Use: getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); in your onCreate method.

There is another way, called a WakeLock, but you really shouldn't use that unless you know what you're doing. See this post from one of the Android designers for more information about WakeLocks and why you shouldn't use them unless you're careful.

0

精彩评论

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