android

[Android] Android Resource 이름으로 id 찾기

sup2is 2019. 2. 22. 11:03









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