I am trying to change the color of a marker.
I have it:
private void addMarker(GoogleMap map, double lat, double lon, int title, int snippet) { map.addMarker(new MarkerOptions().position(new LatLng(lat, lon)) .title(getString(title)) .snippet(getString(snippet)));
and then add the marker:
addMarker(map, 40.748963847316034, -73.96807193756104, R.string.title, R.string.snippet);
I want to change the color of the marker, and I thought it would be easy and simple to implement it like this:
private void addMarker(GoogleMap map, double lat, double lon, int title, int snippet, int icon) { map.addMarker(new MarkerOptions().position(new LatLng(lat, lon)) .title(getString(title)) .snippet(getString(snippet)) .icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.(getString(icon)));
and
addMarker(map, 40.748963847316034, -73.96807193756104, R.string.title, R.string.snippet, HUE_AZURE);
But I can't use "getString" with ".icon", apparently.
How can i do this?
Also, is this color change method supported for API 8+? I had a lot of problems with API 8+ support, and it would suck if it broke something ...