Code example for ProgressDialog

Methods: setOnDismissListener, show

0
 
		@Override 
		protected void onPreExecute() { 
			dialog = ProgressDialog
					.show(activity, "", "Loading...", true, false);
			dialog.setOnDismissListener(new OnDismissListener() {
				@Override 
				public void onDismiss(DialogInterface dialog) {
					if (selfReference != null) {
						selfReference.cancel(true);
					} 
				} 
			}); 
			dialog.show();
		} 
 
		@Override 
		protected Boolean doInBackground(Void... arg0) {
			return getJobInfo(); 
		}