DLee
DLee

Reputation: 300

Android: Assign Drawable Ids to downloaded images

Is there's a way to assign ID to downloaded images? I have a project that all the images are access by IDs, but now the specs has been changed and I need to download images at runtime. I don't want to change how I access the images, because it will cost a fortune for changing it.

If it's not possible to assign IDs during runtime, is there's anyway I can do to minimize the changes for accessing the images?

Thanks!

Upvotes: 0

Views: 130

Answers (1)

zrgiu
zrgiu

Reputation: 6342

It's not possible to assign IDs (like in R.drawable.some_image) to downloaded images, because those IDs are generated at compile-time by the Android SDK and hard-coded in your apk. Nothing in the apk can be modified without recompiling it (think layout xml files, drawables, etc...)

Upvotes: 1

Related Questions