Code example for ProgressDialog

Methods: setButtonsetCancelablesetMessage

0
		this.uploadActivity = uploadActivty;
	} 
 
	@Override 
	protected void onPreExecute() { 
		progDialog.setCancelable(true);
		progDialog.setMessage("Uploading. Please wait...");
		progDialog.setButton("Cancel", new DialogInterface.OnClickListener() {
 
			@Override 
			public void onClick(DialogInterface dialog, int which) {
				AlertDialog.Builder builder = new AlertDialog.Builder(context);
				builder.setMessage("Are you sure you want to cancel?")
						.setCancelable(false)
						.setPositiveButton("Yes",
								new DialogInterface.OnClickListener() {
									@Override 
									public void onClick(DialogInterface dialog,
											int id) {
										cancel(true); // Kill the running thread
Connect your IDE to all the code out there  Get Codota for Java