How to keep active while turning off the screen?

How to keep active when the screen turns off?

+5
source share
3 answers

You will need to use PARTIAL_WAKE_LOCK for your activity to be active. android.permission.WAKE_LOCKmust be requested in your manifest. However, the battery runs out faster, so be sure to release the wakelock as soon as possible.

Use Service Instead

+6
source

There is also a good way. I found this a few months ago and it slightly reduced battery life;)

http://thinkandroid.wordpress.com/2010/01/24/handling-screen-off-and-screen-on-intents/

+1

, "android: noHistory =" true " . , .

, , , , - : , . ! Android OS, , , , , , WAKE_LOCK . 'android: keepScreenOn = "true" ' , .

+1

All Articles