tags:

views:

99

answers:

1

i opened my application after i am not doing any kind of operation i leave the mobile 5 min after 5 min when i touch the my application it is showing black screen.is there any way to avoid this idle state

Thanks in advance

Aswan

+1  A: 

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.

Steve H