I have a custom class ButtonImage.
public ButtonImage(Activity activity) {
face1 = activity.getResources().getIdentifier("face1", "drawable" , activity.getPackageName());
face1i.setImageResource(face1);
...
I have res/drawable, and others (drawable-ldpi, drawable-mdpi, drawable-hdpi, drawable-xhdpi), then I wanna load the faces (I have 4), then when I create the ButtonImage I have NullPointerException on these line (face1 = activity...)
How I can load the images from drawable folder depending of the (ldpi,hdpi, mdpi) folder, I have the 4 images on each folder.
Sorry my english, I hope that you can understand me
Wow Sorry.
I forgot create the Imageviews objetcs;