Reputation: 11362
I'm trying to display marker on Google map. I can do this using a saved icon, for example: Drawable drawable = this.getResources().getDrawable(R.drawable.androidmarker);
however, the chanllange is, i need to use icon that will be retrived from URL. like "icon": "http://maps.gstatic.com/mapfiles/place_api/icons/generic_business-71.png",
any idea how i can do this?
Upvotes: 1
Views: 862
Reputation: 6452
Check out the BitmapFactory.decodeStream() ... passing in the URL.getImputStream() for the image you want to use during runtime.
Lots of examples of this on the net.
Upvotes: 1
Reputation: 2204
It's probably best to download the image from the URL, save it locally and then generate the drawable from that local resource.
Upvotes: 2