I tried earlier and just got more confused so i will try and be more precise. I am making an app in which i have a deck of 7 cards. I want to click on the deck and have one of the 7 cards pop up on the screen. So far I have
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
final MediaPlayer mpClick = MediaPlayer.create(this, R.raw.click);
randomM = (EditText) findViewById(R.id.randomM);
//button 1 start
Button bMythos = (Button) findViewById(R.id.mythos);
bMythos.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
mpClick.start();
Random r = new Random();
int n=r.nextInt(7) + 1;
randomM.setText(String.valueOf(n));
}
});
//button 1 end
}
}
So far this displays the card deck which i click on and a random number is generated (the text box is nearly for me to know the random number generator is working; will be removed when i figure out the display).
So my question How can i get the random number to correspond with a random card and get the card displayed? - the cards are labeled mythos1, mythos2, etc so i assumed i could do something with mythos(String.valueOf(n)) but that didn't work (unless i'm doing something else wrong) [if you can't tell i have no idea what i'm doing]