I need to save images in a resource folder in a SQLite database. This database is preloaded (copied to data / path), so there is no filling at run time. I tried to save it like this in text fields in SQLite: "R.drawable.picture1".
There are about 300 small images (jpg) in my drawer. When I run the query, the cursor returns a particulair string. Now I need to set this as ImageResource in ImageView, but everything I tried seems to not work.
I tried to parse it to int, which does not work. No matter what I tried, logcat keeps telling me that R.id.picture1 is not a valid integer. I saw a possible solution some time ago, but I searched for it all day, but I can not find it.
What I don't need: convert images to byte arrays so that I can save them as blob. I just need a way to store and retrieve the link that I can use to set drawable on the ImageView.
I'm not so experienced, so I hope someone can help me.
source share