Java Reference
In-Depth Information
public void commandAction(Command command, Displayable displayable) {
if (displayable == infoForm) {
if (command == exitCommand) {
exitMIDlet();
}
}
}
private void scheduleMIDlet( ) {
try {
String me = this.getClass().getName();
Date when = new Date();
if ( when.getTime() < whenLaunched + DELAY ) {
PushRegistry.registerAlarm(me, whenLaunched + DELAY);
}
ByteArrayOutputStream baos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream( baos );
dos.writeLong( whenLaunched + DELAY );
byte b[] = baos.toByteArray();
store = RecordStore.openRecordStore(storeName, true);
store.addRecord(b, 0, b.length);
store.closeRecordStore();
}
catch (Exception e) {}
}
private void alarmFired() {
getDisplay().setCurrent(get_alarmAlert(), get_infoForm());
}
public Display getDisplay() {
return Display.getDisplay(this);
}
public void exitMIDlet() {
getDisplay().setCurrent(null);
try {
if ( getDisplay().getCurrent() != get_infoForm() )
{
scheduleMIDlet();
}
}
 
Search WWH ::




Custom Search