I want to put a drawable programatically to my MarkerOptions in Google maps. I get the icon like String and later I try to use it to put the icon of the MarkerOptions.
I am using this code:
String icono = mis_localizaciones.get(i).getIcon();
int id = getResources().getIdentifier(icono, "drawable", getPackageName());
Drawable drawable = getResources().getDrawable(id);
mi_marker.icon(BitmapDescriptorFactory.fromResource(drawable));
But I can´t do like this because there is an issue in : mis_markers.icon(BitmapDescriptorFactory.fromResource(drawable));
Can somebody help me? Thanks a lot