I have an async task in my project like the one below.
@SuppressLint("NewApi")
private void callTask() {
new Task() {
@Override
protected void doInBackground(String... params) {
}
}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR,
string1,string2 );
}
and I call this callTask() method inside a for loop for 10 times.
My tasks are getting executed parallely and it works fine. I want to stop all the task at one point of time. How can I achieve this?