You can use getIdentifier()
for (int j = 1; j < 6; j++) {
Drawable drawable = getResources().getDrawable(getResources()
.getIdentifier("d002_p00"+j, "drawable", getPackageName()));
}
More Related Contents:
- Can the Android drawable directory contain subdirectories?
- R cannot be resolved – Android error
- “R cannot be resolved to a variable”? [duplicate]
- Defining custom attrs
- Android splash screen image sizes to fit all devices
- Passing image from one activity another activity
- how to access the drawable resources by name in android
- Android Drawable Images from URL
- 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]
- Applying ColorFilter to ImageView with ShapedDrawable
- Packaging Android resource files within a distributable Jar file
- Android : Understanding drawable folder
- Why isn’t my vector drawable scaling as expected?
- Tiled drawable sometimes stretches
- How to clear an ImageView in Android?
- Android Studio: Creating landscape layouts
- String Resource new line /n not possible?
- Android: html in strings.xml
- Changing gradient background colors on Android at runtime
- Change background of EditText’s error message
- Get the displayed size of an image inside an ImageView
- What’s the correct size icon for drawable-xxhdpi?
- Android Button Drawable Tint
- Refreshing a LinearLayout after adding a view
- How to support all the different resolutions of android products
- How to set status bar background as gradient color or a drawable in Android?
- Modifying the color of an android drawable
- ERROR No package identifier when getting value for resource number