I have an app with a ViewSwitcher which holds a MapView and another View and I want to save the MapView's bitmap as an image. This works well, if the MapView has been visible at least once by doing something like that:
mapView.setDrawingCacheEnabled(true);
Bitmap bm = mapView.getDrawingCache();
/* ... save bitmap ... */
Problem is, if the MapView hasn't been visible, getDrawingCache()
returns null
for the bitmap. Is there any way how I can resolve that?