Adding a bitmap to the drawable resources

后端 未结 2 1642
野的像风
野的像风 2021-01-13 00:13

How can I add a Bitmap taken from the web (in the app i mean!) to the drawable resources? So i can access the Bitmap using R.drawable.bitmapN

2条回答
  •  死守一世寂寞
    2021-01-13 00:38

    The resources are compiled at the apk building time, so you cannot change it in runtime. If you want to have some identifier you can consider creating a shared preference where you can put in relation the downloaded image file with some id. But it will take some effort from you to implement the functionality.

提交回复
热议问题