Code example for ProgressDialog

Methods: getMaxsetMessagesetProgress, dismiss

0
*/ 
	final Handler handler = new Handler() {
		public void handleMessage(Message msg) { 
			int step = msg.getData().getInt("step"); 
			String text = msg.getData().getString("text"); 
			dialog.setProgress(step); 
			dialog.setMessage(text); 
			if (step >= dialog.getMax()) { 
				dialog.dismiss(); 
			} 
		} 
	}; 
 
	protected class ProgressThread extends Thread {
		Handler h;
		int step;
		int total;
 
		ProgressThread(Handler h) {
			this.h = h;
		}