Last active
January 19, 2018 10:32
-
-
Save JillevdW/0636c4b29f48ebaee74e1d2bdab2e7ac to your computer and use it in GitHub Desktop.
ImageRequest kotlin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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