我知道這很容易做到,但我試圖從這裏拿一些例子,並沒有顯示progressDialog。我想要做的是在點擊按鈕時顯示ProgressDialog,並在任務完成時完成:ProgressDialog不顯示在android
在此先感謝!
buttonStartOCR.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
progress = ProgressDialog.show(SimpleAndroidORCActivity.this, "Processing", "Please wait...", true);
new Thread(new Runnable() {
public void run() {
runOnUiThread(new Runnable() {
@Override
public void run() {
onPhotoTaken();
}
});
};
}).start();
progress.dismiss();
}
});
刪除progress.dismiss();並檢查它 – Vadivel