I have a slider that can be lifted to see a map. To show or hide the map, I can slide the slider up or down. I can manage touch events on the map while it is in front of me. An AsyncTask is launched each time I touch the screen, downloading data as it goes and creating a Toast that displays it. Despite starting the task upon touch event, no toast is shown until the slider is closed. The Toast occurs after the slider has been closed and the map has been hidden.
Any ideas?
Well start the task
EDIT:
public boolean onTouchEvent(MotionEvent event, MapView mapView){
if (event.getAction() == 1) {
new TestTask(this).execute();
return true;
}else{
return false;
}
}
and in onPostExecute make a toast
Toast.makeText(app.getBaseContext(),(String)data.result,
Toast.LENGTH_SHORT).show();
In new TestTask(this), this is a reference to MapOverlay and not to MapActivity, so this was the problem.