I’m using AIButton
in my app and I have a AsyncTask
which gets executed after AIButton is clicked and receives some command and AsyncTask sometimes
Try to set resultListener for your AIButton and implement onCancelled() method canceling your AsyncTasks from there.
To mark an AsyncTask as required to stop you should call
asyncTask.cancel(false);
And in your AsyncTask you have to check periodically whether it was cancelled or not by calling isCancelled()
. If this method returns true you should stop execution.