My WakeLock isn't keeping my device awake.
In OnCreate()
I've got:
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
mWakeLock = pm.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK | PowerManager.ON_AFTER_RELEASE, "My Tag");
mWakeLock.acquire();
then:
new CountDownTimer(1320000, 200) {
public void onTick(long millisUntilFinished) {
// I update a progress bar here.
}
public void onFinish() {
// I finish updating the progress bar.
mWakeLock.release();
}
}.start();
The screen turns off before the timer finishes, how can I make the screen stay visible?
mWakeLock
is a field previously declared like so:
private PowerManager.WakeLock mWakeLock;
My device uses Android 1.6. I would really appreciate any help to resolve this.