我只想在我的 Lwiit J2ME 应用程序中解析一些 Xml 时显示加载屏幕。我看到有很多例子,例如滑块和仪表,我找到了这个简单的代码,但我不知道如何在解析操作时显示对话框。如果我使用 dialog.showDialog(); 它会阻止用户界面
passenger p = new passenger();
p.start();
synchronized (p) {
System.out.println("passenger is waiting for the bus ");
try {
p.wait();
} catch (InterruptedException ex) {
ex.printStackTrace();
}
System.out.println("passenger got notification");
// I think that i must use the loading thing here but i don't know
// what to do.
}
System.out.println("after "+p.total+" time");
class passenger extends Thread {
int total = 0;
public void run() {
synchronized (this) {
System.out.println("wait .... ");
for (int i = 0; i <= 3000; i++){
total = total + i;
System.out.println(total+"");
}
System.out.println("passenger is given notification call");
notify();
}
}