有人可以告诉我为什么在线程完成之前,以下代码中的ProgressDialog没有显示在UI上吗?
Common.prog = ProgressDialog.show(cContext, "Please wait", "Checking Voucher...", true);
final Handler handler = new Handler() {
public void handleMessage(Message msg) {
Common.prog.dismiss();
}
};
Thread searchThread = new Thread() {
public void run() {
processCoupon(voucherCodeEditText.getText().toString());
handler.sendEmptyMessage(0);
};
};
searchThread.run();
提前致谢:)
答案 0 :(得分:1)