Skip to content

Instantly share code, notes, and snippets.

@JillevdW
Last active January 19, 2018 10:32
Show Gist options
  • Select an option

  • Save JillevdW/0636c4b29f48ebaee74e1d2bdab2e7ac to your computer and use it in GitHub Desktop.

Select an option

Save JillevdW/0636c4b29f48ebaee74e1d2bdab2e7ac to your computer and use it in GitHub Desktop.
ImageRequest kotlin
class ImageRequest() : AsyncTask<String,Void,Bitmap>() {
override fun doInBackground(vararg params: String?): Bitmap {
val stream = URL(params[0]).openConnection().getInputStream()
val bmp = BitmapFactory.decodeStream(stream)
return bmp
}
override fun onPostExecute(result: Bitmap?) {
super.onPostExecute(result)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment