0

I have a database holding a lot of static data for my current application. One of the tables in the database gives various information about a list of items. It would make sense for it to hold a reference to the graphic for each item, too. The graphics are stored in a drawable folder and referenced by R.drawable in the application. Am I able to reference them by their name so that I can store the names as strings in the database? If not, is there an obvious method for doing this that I'm missing?

Rok
  • 2,568
  • 4
  • 26
  • 28

1 Answers1

1

Am I able to reference them by their name so that I can store the names as strings in the database?

Yes. Take a look at this answer:

Android and getting a view with id cast as a string

Community
  • 1
  • 1
Cristian
  • 198,401
  • 62
  • 356
  • 264