converting drawable resource image into bitmap

前端 未结 6 1852
星月不相逢
星月不相逢 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:55

    In res/drawable folder,

    1. Create a new Drawable Resources.

    2. Input file name.

    A new file will be created inside the res/drawable folder.

    Replace this code inside the newly created file and replace ic_action_back with your drawable file name.

    
    

    Now, you can use it with Resource ID, R.id.filename.

提交回复
热议问题