-
-
Save JillevdW/11792f8ea0bb075eba98fc5b20cab683 to your computer and use it in GitHub Desktop.
AsyncTask 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(val url: String): AsyncTask<Void,Void,Bitmap>() { | |
override protected fun doInBackground(vararg params: Void?): Bitmap { | |
val bmp = BitmapFactory.decodeStream(URL(url).openConnection().getInputStream()) | |
return bmp | |
} | |
override protected 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