Skip to content

Instantly share code, notes, and snippets.

@stuartbates
Created August 20, 2020 15:44
Show Gist options
  • Save stuartbates/b4a4cbd07adad48c1b6dc40abd7cf14d to your computer and use it in GitHub Desktop.
Save stuartbates/b4a4cbd07adad48c1b6dc40abd7cf14d to your computer and use it in GitHub Desktop.
suspend fun downloadMarker {
val furl = URL(myURL)
val bm = BitmapFactory.decodeStream(furl.openConnection().getInputStream())
return BitmapDescriptorFactory.fromBitmap(bm)
}
val bd = withContext(Dispatchers.IO) { downloadMarker() }
marker.setIcon(bd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment