the icon name is : icon1.png
.icon(BitmapDescriptorFactory.fromResource(R.drawable.icon1)));
I want to use the String icon_name
the String icon_name will be updated from server, but all the icons are in drawable. I just change the name, and the code should search in folder drawable.
That means, it should like that :
.icon(BitmapDescriptorFactory.fromResource(xxxxx icon_name)));
I have tried like that :
.icon(BitmapDescriptorFactory.fromResource(Integer.parseInt("R.drawable."+icon_name))));
android-studio accepts the format but it does not understand it as path.
how can I implement this to make to icon-name variable and not fixed?
I just want to change the Icon from Server from time to time.