ProgressDialog 使用以及关键属性解释

先说使用

// 显示登陆对话框

				prgDialog = new ProgressDialog(OrderMainActivity.this);
				prgDialog.setIcon(R.drawable.progress);
				prgDialog.setTitle("请稍等");
				prgDialog.setMessage("正在登陆,请稍等...");
				prgDialog.setCancelable(false);
				prgDialog.setIndeterminate(true);
				prgDialog.show();

ProgressDialog.setIndeterminate(true)

不明确就是滚动条的当前值自动在最小到最大值之间来回移动,形成这样一个动画效果,这个只是告诉别人“我正在工作”,但不能提示工作进度到哪个阶段。主要是在进行一些无法确定操作时间的任务时作为提示。而“明确”就是根据你的进度可以设置现在的进度值。

 

 

ProgressDialog.setCancelable (boolean cancelable)

设置为false,按返回键不能退出。默认为true。

 

 

猜你喜欢

转载自squall140.iteye.com/blog/1733831