在 Android 上加载数据时显示旋转轮对话框
我想在我的应用加载一些数据时显示旋转轮对话框:
旋转轮对话框应在单击按钮时显示。我正在使用下面的代码,但它现在确实显示了旋转的轮子。可能是什么问题?
public void CheckAccount(String username, String password) {
try {
final ProgressDialog progDailog = ProgressDialog.show(this,
"Progress_bar or give anything you want",
"Give message like ....please wait....", true);
new Thread() {
public void run() {
try {
// sleep the thread, whatever time you want.
sleep(1000);
} catch (Exception e) {
}
progDailog.dismiss();
}
}.start();
//getting data code here
//getting data code here
//getting data code here
//getting data code here
//getting data code here
} catch (Exception e) {
Log.e(LOG_TAG, e.getMessage());
PopIt("CheckAccountError", e.getMessage(), "Denied");
}
}