: AsyncTask<Uri, Unit, Drawable>() { private val activity = WeakReference(activity) override fun doInBackground(vararg params: Uri?): Drawable? { val uri = params[0] ?: return null val capture = loadCapture(uri) ?: return null val renderScript = activity.get()?.let { RenderScript.create(it) } ?: return null val blurredCapture = RSBlurProcessor(renderScript).blur(capture, 25f, 3) ?: return null val resources = activity.get()?.resources ?: return null return BitmapDrawable(resources, blurredCapture) } override fun onPostExecute(result: Drawable?) { super.onPostExecute(result) activity.get()?.onLoadBlurredCapture(result) }