在 Eclipse 中没有错误,但无法在 Blackberry Simulator 上运行。错误 104 非法监控状态异常
在模拟器中运行应用程序时,我在启动时收到错误消息应用程序错误 104非法监视器状态异常。 Eclipse 中没有错误,模拟器也可以处理其他代码,所以我认为没有任何问题。
代码:
package mypackage;
import net.rim.device.api.ui.container.MainScreen;
import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.component.LabelField;
class hello extends UiApplication {
hello() {
MainScreen SCREEN = new MainScreen();
SCREEN.setTitle("mygismo.com");
// CREATE STRING
String[] mymsgs = { "Cheese", "Pepperoni", "Black Olives" };
// AND INITIATE LOOP
for (int i = 0; i < 10; i++) {
// UPDATE SCREEN
SCREEN.add(new LabelField(mymsgs[i]));
pushScreen(SCREEN);
// WAIT 5 seconds
try {
wait(5000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
public static void main(String args[]) {
hello APP = new hello();
APP.enterEventDispatcher();
}
}
When running the App in the simulator i get the error msg App Error 104 illegalmonitorstateexception on startup.
There are no errors from within Eclipse and the Simulator works on other code so nothing wrong there i think.
Code:
package mypackage;
import net.rim.device.api.ui.container.MainScreen;
import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.component.LabelField;
class hello extends UiApplication {
hello() {
MainScreen SCREEN = new MainScreen();
SCREEN.setTitle("mygismo.com");
// CREATE STRING
String[] mymsgs = { "Cheese", "Pepperoni", "Black Olives" };
// AND INITIATE LOOP
for (int i = 0; i < 10; i++) {
// UPDATE SCREEN
SCREEN.add(new LabelField(mymsgs[i]));
pushScreen(SCREEN);
// WAIT 5 seconds
try {
wait(5000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
public static void main(String args[]) {
hello APP = new hello();
APP.enterEventDispatcher();
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您一次又一次地添加相同的屏幕。
这就是问题所在。
You are adding the same screen over and over again.
That's the problem.