I want to stop a AsyncTask
thread from another AsyncTask
thread. I have tried like
new AsyncTask.cancel(true)
to stop the background process but it didn't stop.
Could any one help me on this?
declare your asyncTask in your activity:
private YourAsyncTask mTask;
instantiate it like this:
mTask = new YourAsyncTask().execute();
kill/cancel it like this:
mTask.cancel(true);