我是 Android 开发新手,正在尝试解决这个让我有些沮丧的问题。我正在尝试关闭此 progressDialog。当我运行该应用程序时,它会显示、获取信息并更新 UI。但是,对话框永远不会被关闭。
progDialog = ProgressDialog.show(HomeActivity.this, "", "Fetching info...", true, false);
new Thread(new Runnable() {
public void run() {
fetchInfomation(userID); //fetches information - Works
runOnUiThread(new Runnable() {
public void run() {
setLayoutList(); //updates UI - Works
progDialog.dismiss(); //doesn't seem to close progress dialog
firstView(); //displays prompt - Works
}
});
progDialog.dismiss(); //doesn't close dialog either
}
}).start();
有任何想法吗?