0

I am trying to load an image to a push notification using Glide

            val imageLoader = ImageLoader(this)
            val request = ImageRequest.Builder(this)
                .data(data.user_avatar_url?.replace(URL))
                .target(
                    onSuccess = { result ->
                        val  bitmap = (result as BitmapDrawable).bitmap
                        notificationBuilder.setLargeIcon(bitmap) // notification builder method
             
                    },
                    onError = {
                    }
                ).build()

            imageLoader.enqueue(request)

it does not load image in notification tray

Ashwin Nirmale
  • 443
  • 4
  • 13
  • You need to wait for image to load first and then send the notification .. Image loading is asynchronous.. – ADM Dec 06 '22 at 06:07

0 Answers0