【发布时间】:2011-02-25 21:13:07
【问题描述】:
我在进程运行时使用 ProgressDialog 时遇到问题。我已经尝试了所有可能的错误方法,并查看了许多网站,这些网站提供了我正在尝试做的示例,但是,我仍然遇到了在 ProgressDialog 出现之前线程正在运行的问题。这是我最近的尝试:
new Thread(new Runnable() {
public void run() {
dialog = new ProgressDialog(EPD.this);
dialog.setMessage("Loading. Please Wait...");
dialog.show();
}
}).run();
getMostWanted();
除了尝试这种方式之外,我还尝试在 getMostWanted() 中创建一个新线程,但是我仍然得到相同的结果。当 getMostWanted() 没有对话框时,它会暂停约 4 或 5 秒。
提前感谢您的帮助。
【问题讨论】:
标签: android multithreading progressdialog