Code example for AsyncTask

Methods: cancel

0
 
	protected void onPause() { 
		super.onPause(); 
		AsyncTask<Void, Void, Builder> task = currentTask;
		if (task != null) {
			task.cancel(true);
			currentTask = null;
		} 
	} 
 
	private void onRegisterButton(View view) {
		if (this.arePasswordsEqual()) {
			final WAZServiceRegisterActivity thisActivity = this;
			class RegisterTask extends AsyncTask<Void, Void, AlertDialog.Builder> {
				protected AlertDialog.Builder doInBackground(Void... params) {
					try { 
						WAZServiceAccount account = new WAZServiceAccount(
								new WAZServiceUsernameAndPassword(usernameText.getText().toString(), passwordText.getText().toString()),
								new URI(wasServicesBaseUrlText.getText().toString()));
 
Experience pair programming with AI  Get Codota for Java