1
int drawableResourceId = this.getResources().getIdentifier("nameOfDrawable""drawable"this.getPackageName());
cs



I warn you, this way of obtaining identifiers is really slow, use only where needed.



https://stackoverflow.com/questions/3476430/how-to-get-a-resource-id-with-a-known-resource-name

https://stackoverflow.com/questions/3476430/how-to-get-a-resource-id-with-a-known-resource-name

https://stackoverflow.com/questions/3476430/how-to-get-a-resource-id-with-a-known-resource-name

+ Recent posts