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.
AsyncTask
new AsyncTask.cancel(true)
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);
1.4m articles
1.4m replys
5 comments
57.0k users