How to get list of image with R.Drawable
问题 In order to create a tile management system I have a pack of image in my res/drawable directory. How to load that ressource dynamically ? like : F_16.0_0_112.jpg. ("F_"+zoom"+"._"+XCoord+"_"+YCoord".jpg") Is there a fonction like getDrawable(String) ? 回答1: You can get a drawable using its name by: int id = getResources().getIdentifier("name_of_resource", "id", getPackageName()); 回答2: You can get this using reflection (dont forget to import java.lang.reflect.Field) /** * For example calling