I am trying to get a random image from my drawable folder, and set it in an ImageView. All the images start with "kitten" and are followed by a number, 1 through 17, which is hardcoded into the variable "kittensMax". When I run my code, it throws a NumberFormatException on the third line here. I believe the problem is that "R.drawable.kitten#" is not a number that can be "parsed" to an int, since it represents an int. Any suggestions?
Random r = new Random();
String drawableKitten = "R.drawable.kitten" + r.nextInt(kittensMax);
kittensImageView.setImageResource(Integer.parseInt(drawableKitten));