I have an application that has a MapView. When user zooms or pans MapView, I execute a new instance of an AsyncTask to fetch MapView's data from server.
Assume that user pans map and we trigger async task to fetch map's data, before getting all data and updating map, user moves map again and a second async task will trigger. If the second async task finishes before first async task, it will update map, but after finishing first async task, mapview will be updated again and will show wrong data to user.
I want to know is there a way to stop (cancel) running async task and execute another one? If yes, how?