KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
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). But (obviously) the async task doesn't stop. So how can I fix this? I want to cancel both dialog and async task when I press the back button. Any ideas?
Tags (comma-separated)
Save Edits
Cancel