I set the alarm and everything and it works perfect, except that the timer never works and I don't know why.
long now = new Date().getTime();
stringItem3 = new StringItem(alarmDate.toString(), null);
System.out.println(alarmDate.getTime() - now);
long amount = alarmDate.getTime() - now;
alarmTimer.schedule(at, amount); //error here
System.out.println("im here");
}
class Alarmer extends TimerTask {
public void run() {
System.out.println("i run");
}
}Everytime though, it reaches the alarmTimer.schedule and throws this error:TRACE: <at java.lang.NullPointerException: 0>, Exception caught in Display class
java.lang.NullPointerException: 0
at VisualMIDlet.doAlarm(VisualMIDlet.java:510)
at VisualMIDlet.commandAction(VisualMIDlet.java:189)
at javax.microedition.lcdui.Display$ChameleonTunnel.callScreenListener(), bci=46
at com.sun.midp.chameleon.layers.SoftButtonLayer.processCommand(), bci=74
at com.sun.midp.chameleon.layers.SoftButtonLayer.soft1(), bci=37
at com.sun.midp.chameleon.layers.SoftButtonLayer.softPress(), bci=29
at com.sun.midp.chameleon.layers.SoftButtonLayer.pointerInput(), bci=142
at com.sun.midp.chameleon.CWindow.pointerInput(), bci=76
at javax.microedition.lcdui.Display$DisplayEventConsumerImpl.handlePointerEvent(), bci=19
at com.sun.midp.lcdui.DisplayEventListener.process(), bci=296
at com.sun.midp.events.EventQueue.run(), bci=179
at java.lang.Thread.run(Thread.java:619)510 is the alarmTimer.schedule line. Any ideas? Please.


Sign In
Create Account



Back to top









