开发者

Black screen is displaying in Android

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜