CSC 349: The Week beginning Sept. 18 |
Random rand = new Random(); int die = rand.nextInt(6) + 1;It should display the corresponding images. You can use Dice.zip or find images you like better.
switch
statement to
connect the user's selected dog (e.g. Lhasa Apso) to the resourse R.drawable.lhasa_apso with cases looking
like
case "Lhasa Apso": ivDog.setImageResource(R.drawable.lhasa_apso); break;But this one takes adavantage of the relationship between the resource name and the dog breed name.