1.效果图
public void click(View view) {final ProgressDialog pdDialog &#61; new ProgressDialog(this);//设置标题pdDialog.setTitle("");//设置图标pdDialog.setIcon(R.mipmap.ic_launcher);//设置内容pdDialog.setMessage("数据加载中……");//返回键不能取消pdDialog.setCancelable(false);//设置进度条样式pdDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);pdDialog.setMax(100);pdDialog.show();new Thread(new Runnable() {&#64;Overridepublic void run() {try {for (int i &#61; 1; i <150; i&#43;&#43;) {Thread.sleep(100);pdDialog.setProgress(i);}pdDialog.dismiss();} catch (InterruptedException e) {// TODO Auto-generated catch blocke.printStackTrace();}}}).start();}