I have an activity which makes periodic requests (once every 15 seconds to get a json data feed). The requests I am passing off to a AsyncTask so its not on the main UI thread. So far so good. But lets say that I request the feed and it takes 20 seconds to respond. I really don't want to kick off another thread until say 30 seconds are up. So ....
Is there a way to prevent the AsyncTask from running if there first one has not yet finished?
Also is there a way to timebox the AsyncTask to take no more than 30 seconds? reguardless of the Http timeout?
Thanks, Steve