I have an app which is used for lets say 4 hours, but only every 5 minutes a user needs to make an input or read the screen. Putting the phone to sleep and locking the scre
Does this answer your last Q from Jan 26 '11 at 15:28
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK, "My Tag");
wl.acquire();
..screen will stay on during this section..
wl.release();
See here for more: http://developer.android.com/reference/android/os/PowerManager.html
So what I mean is that you should acquire power managers wake lock before you launch your new activity to prevent screen lock. And release when you are done.
You could likewise use lp.screenBrightness instead of lp.dimAmount
And be sure to enter value higher then 0 to avoid screen lock:
lp.screenBrightness = 0.01f + value / 100.0f;