I have three activities in my app. I want to keep the screen awake when it is in the second activity. The screen should not go off in my second activity unless the \"lock\"
This code is deprecated, use this instead:
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
wl = pm.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK, "My Tag");
wl.acquire();
After you finish with usage, call (best solution is to call this method in onDestroy method of some activity):
wl.release();
More about this on this link