I am searching about how to save the image of map from mapview. But still found nothing. I used the below code but I still got the error of "Unable to start Activity... NullPointer Exception".
I am stuck on this query. Has anyone managed to do this?
mapView.setWillNotCacheDrawing(false);
mapView.destroyDrawingCache();
mapView.buildDrawingCache();
// Copy the drawing cache before the system recycles it
Bitmap cachedImage = Bitmap.createBitmap(mapView.getDrawingCache());
Bitmap bmap = Bitmap.createBitmap(mapView.getWidth(), mapView.getHeight(),
Bitmap.Config.ARGB_8888);
Canvas offscreencanvas = new Canvas(bmap);
offscreencanvas.drawBitmap(cachedImage, 0, 0, null);