Use getStatus()
to get the status of your AsyncTask
. If status is AsyncTask.Status.RUNNING
then your task is running.
EDIT: you should reconsider your implementation and hold the AsyncTask
probably in a Service
or IntentService
to fetch your data from the web.