I have my asyncTask run when the activity first starts, then if network connectivity is not available then i have a refresh button that tries to run the asyncTask to try aga
You could cancel your asyncTask when you press the button and then execute it again.
Inside OnClic method:
asyncTask.cancel(); AsyncTask asyncTask = new AsyncTask(); asyncTask.execute();