I use sqlite I'm my app to store and retrieve names and and images. I use below code to get names of the images to show in the Recyclerview.
int resID = getResources().getIdentifier(iconName, "drawable", getPackageName());
Here I get this warning
getIdentifier is discouraged because resource reflection makes it harder to perform build optimizations
what is the replacement for this?
Before that I used image id instead of image name to store it in sqlite but it gets problems if I add or remove images from drawable as soon as project recompile again. So, I figured it out that it's better to store images using image name instead of image id.