With something like this:
String mDrawableName = "myappicon";
int resID = getResources().getIdentifier(mDrawableName , "drawable", getPackageName());
More Related Contents:
- Get resources images from variable
- About Android image and asset sizes
- How to clear an ImageView in Android?
- R cannot be resolved – Android error
- How to pick an image from gallery (SD Card) for my app?
- Saving and Reading Bitmaps/Images from Internal memory in Android
- “R cannot be resolved to a variable”? [duplicate]
- Can the Android drawable directory contain subdirectories?
- Defining custom attrs
- How to get Bitmap from an Uri?
- How to create a circular ImageView in Android? [duplicate]
- Remove all unused resources from an android project
- Open an image using URI in Android’s default gallery image viewer
- How to get access to raw resources that I put in res folder?
- Duplicate value for resource ‘attr/font’ with config “
- getResources().getColor() is deprecated [duplicate]
- Load dimension value from res/values/dimension.xml from source code
- Android Resources$NotFoundException: Resource ID #0x7f030027
- Packaging Android resource files within a distributable Jar file
- Android Studio cannot resolve R in imported project?
- Android: What is android.R.id.content used for?
- Android Studio: Creating landscape layouts
- String Resource new line /n not possible?
- How to display a list of images in a ListView in Android?
- Android: html in strings.xml
- How to convert Image to PDF?
- How to find resource id of a file located in /res/raw folder by its filename?
- Using Locale to force Android to use a specific strings.xml file for a non-supported language
- Getting resources of another Application
- Set Imageview to show image in sdcard?