Issue
I have added 720 new images to my Drawable
folder, but none of them are being recognized when I use Field[] drawables = android.R.drawable.class.getFields();
.
Field[] drawables = android.R.drawable.class.getFields();
for (Field f : drawables) {
try {
System.out.println("R.drawable." + f.getName());
} catch (Exception e) {
e.printStackTrace();
}
}
This just returns a list of the images added by default to the Drawable
folder. I also tried getDeclaredFields
but no success.
Solution
You need to use your own generated R class, that's your.package.name.R.drawable
.
Answered By - Dave Morrissey
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.