I am using an AsyncTask in my application to provide the user with data when he pan or zoom the google map, I want to implement a way that cancels the current execution and execute the new request instead when the user pan/zoom so fast that he changes the location before the data is loaded, because the user will no longer need the data when he change or zoom the location on the map.
Thanks in advance
you can cancel the AsyncTask that is in execution by just calling cancel method of AsyncTask
i.e., _connectAsyncTask.cancel(true);
where _connectAsyncTask is an instance of AsyncTask…..