I am trying to display an image when i have variable from array (arr[r1]) which matches the name of the picture. I tried using this but it didnt work:
ImageView imageView = (ImageView)findViewById(R.id.imageView);
imageView.setImageDrawable(getResources().getDrawable(getResources().getIdentifier("drawable/"+arr[r1], "drawable", getPackageName())));
Any idea what i am doing wrong?