How to keep active when the screen turns off?
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.
android.permission.WAKE_LOCK
Use Service Instead
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/
, "android: noHistory =" true " . , .
, , , , - : , . ! Android OS, , , , , , WAKE_LOCK . 'android: keepScreenOn = "true" ' , .