//初始化进度框
public void showProgressDialog(){
//建立一个进度框
final ProgressDialog proDialog=new ProgressDialog(AddPayoutIncomeActivity.this);
//设置dialog的信息
proDialog.setMessage("正在保存数据...");
proDialog.show();
//新建一个线程,将proDialog放在线程中执行
Thread thread=new Thread(new Runnable() {
@Override
public void run() {
try {
Thread.sleep(1000);//线程时间为1秒
proDialog.dismiss();//关闭dialog对话框
} catch (InterruptedException e) {
e.printStackTrace();
}
}
});
thread.start();
}//end of showProgressDialog
创建android的进度框
最新推荐文章于 2021-12-11 11:29:42 发布