Methods Summary |
---|
private void | cancelTimer()Cancel any running Timer.
if (task != null) {
task.cancel();
task = null;
}
|
public boolean | flashBacklight(int duration)Requests a flashing effect for the device's backlight.
if (duration < 0) {
throw new IllegalArgumentException();
}
if (duration == 0) {
showBacklight(false);
cancelTimer();
}
// start timer
setTimer(duration);
return showBacklight(true);
|
private void | setTimer(int duration)Set a new timer.
cancelTimer();
try {
task = new TimerClient();
// execute for the duration in milli seconds
timerService.schedule(task, duration);
} catch (IllegalStateException e) {
e.printStackTrace();
cancelTimer();
}
|
private native boolean | showBacklight(boolean on)show Backlight
|