Code example for ProgressDialog

Methods: setMessagesetProgresssetProgressStyle, setCancelable, setOnCancelListener, show

0
		_statsTask.execute( hash, tracker, destination );
	} 
	 
	// creates the progress dialog 
	protected void SwiftCreateProgress() { 
		_dialog = new ProgressDialog(VideoPlayerActivity.this);
	  _dialog.setCancelable(true);
	  _dialog.setMessage("Buffering...");
	  // set the progress to be horizontal 
	  _dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
	  // reset the bar to the default value of 0 
	  _dialog.setProgress(0);
	   
	  //stop the engine if the procress scree is cancelled 
	  _dialog.setOnCancelListener(new OnCancelListener() {
			 
			@Override 
			public void onCancel(DialogInterface dialog) {
//				_text.setText("TODO HTTPGW engine stopped!"); 
				// Arno, 2012-01-30: TODO tell HTTPGW to stop serving data 
				//nativelib.stop(); 
				// Raul, 2012-03-27: don't stay here with a black screen.  
				// Go back to video list 
				finish();
			} 
		}); 
	 
	  // display the progressbar 
	  _dialog.show();
	   
	} 
	 
	 
	//starts the video playback