Cancel An Asynctask Inside Itself
So my problem is as follows, I have an AsyncTask Class that is called from a preference file ie. The intent is called from within an xml file. This AsyncTask Class is continuously
Solution 1:
Can you post some code?
In your calling method (in which you might be able to check for keys), you can call myASyncTask.cancel()
and then in the doInBackground()
method of your AsyncTask, you can check for isCancelled()
and then break your loop and return to your overridden onCancelled()
method of your AsyncTask.
http://developer.android.com/reference/android/os/AsyncTask.html#cancel(boolean)
Does that help?
Post a Comment for "Cancel An Asynctask Inside Itself"