Reputation: 3468
Say there is an AsyncTask that is triggered from a UI button, and the button click triggers execute() to start the task. What happens if the task is in the middle of execution, and user calls execute() again?
I know this can be prevented by checking AsyncTask.getStatus()
, but what happens if I don't want to check that?
Upvotes: 1
Views: 324
Reputation: 7603
Due to AsyncTask doc:
There are a few threading rules that must be followed for this class to work properly:
The AsyncTask class must be loaded on the UI thread. This is done automatically as of JELLY_BEAN.
Hope this help!
Upvotes: 2