converting drawable resource image into bitmap

前端 未结 6 1842
星月不相逢
星月不相逢 2020-12-02 05:22

I am trying to use the Notification.Builder.setLargeIcon(bitmap) that takes a bitmap image. I have the image I want to use in my drawable folder so how do I con

6条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-02 05:56

    First Create Bitmap Image

    Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.image);
    

    now set bitmap in Notification Builder Icon....

    Notification.Builder.setLargeIcon(bmp);
    

提交回复
热议问题