Android: Cancel Async Task
I use an async task to upload an image and get some results. While uploading the image I see a progress dialog, written in onPreExecute() method like this: protected void onPreExecute() { uploadingDialog = new ProgressDialog(MyActivity.this); uploadingDialog.setMessage(“uploading”); uploadingDialog.setCancelable(true); uploadingDialog.show(); } Ok when I press the back button, obviously the dialog disappears because of the setCancelable(true). … Read more