I have a png image inside my Drawable folder. The same image I use it in many markers but in different sizes. Instead of creating many images with different sizes, I wanted to create XMLs inside the Drawable folder reusing the orignial image.
I tried solutions on this answers: Scale a drawable resource in XML (Android) but they are not working in my cases. When I reach
BitmapDescriptor scaledIcon = BitmapDescriptorFactory.fromResource(R.drawable.scaled_marker_image); //scaled_marker_image is the XML that resize the original image
mMap.addMarker(new MarkerOptions().position(new LatLng(location.getLatitude(), location.getLongitude())).title("Marker").icon(scaledIcon));
Basically in the MarjerOptions().icon(scaledIcon)
I get nullPointerException
Any ideas how to achieve this?