I press login button to login into my app and
I’m using asyncTask for this process. when I press the cancel button, it should stop the login process but what happens is when I press the cancel button the dialog box goes but login process doesn’t stop and evemtually the user is logged in :).
I used asyncTaskObject.cancel(true) to stop the process but nothing happens. How can I correct this.
The
AsyncTaskdocument states that the method cancel():The solution is also provided in the documentation which says:
Check this link:
http://developer.android.com/reference/android/os/AsyncTask.html#cancel(boolean)