如何在特定时间自动启动Midlet?
|
我想使用Push注册表在指定的时间启动Midlet。当我运行该应用程序时,即使超过时间,midlet也不会启动。
public void startApp(){
System.out.println( \"AlarmMIDlet: startApp\" );
try {
Date now = new Date();
long previous;
String cn = this.getClass().getName();
System.out.println(\"Class name : \"+cn);
previous = PushRegistry.registerAlarm( \"hello.AlarmMIDlet\", now.getTime() + 600 );
System.out.println( \"AlarmMIDlet: time of previous alarm: \" + previous );
} catch ( java.lang.ClassNotFoundException cnf ) {
System.out.println( \"AlarmMIDlet: Class not Found\" );
} catch ( javax.microedition.io.ConnectionNotFoundException connnf ) {
System.out.println( \"AlarmMIDlet: Connection Not Found\" );
}
System.out.println( \"AlarmMIDlet: startApp: return\" );
notifyDestroyed();
}
有人遇到过类似的问题吗?如何解决?
没有找到相关结果
已邀请:
1 个回复
澳绍能