我希望在listview加载时显示ProgressDialog。我已经尝试了以下代码,但它没有起作用。
但它完全没有起作用。
final ProgressDialog dialog = ProgressDialog.show(this, "indeterminate", "Please wait while loading", true);
final Handler handler = new Handler() {
public void handleMessage(Message msg) {
dialog.dismiss();
}
};
Thread checkUpdate = new Thread() {
public void run() {
// listview will be populated here
PopulateListView();
handler.sendEmptyMessage(0);
}
};
checkUpdate.start();
但它完全没有起作用。