private ProgressDialog mProgressDlg = null; @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//---开始显示ProgressDialog对话框
mProgressDlg = ProgressDialog.show(this, "提示", "正在在加载", true);
//----通过线程模拟加载任务
new Thread(){
public void run() {
try {
Thread.sleep(5000);
//---加载完成后必须Progress 对话框
mProgressDlg.dismiss();
}
catch(Exception ex) {
ex.printStackTrace();
}
}
};
}