سؤال

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.bitmapName...

هل كانت مفيدة؟

المحلول

You can't modify that folder once your app is installed. In that case, you must copy the bitmap to a file and access it from there. Take a look at this other question:

Save bitmap to location

نصائح أخرى

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top