Hey all - In Android, I wrote a number of strings in my string.xml I would like to display on a TextView based on a random number...Here is what I have:
int randCropPercentage = (int) Math.ceil(Math.random() * 100);
Random randPhrase50 = new Random();
int[] array50 = new int[] { R.string.ss2, R.string.ss4, R.string.ss5,
R.string.st4, R.string.st5, R.string.tt2, R.string.tt3,
R.string.tt5, R.string.to2, R.string.to3, R.string.to4,
R.string.os5 };
int randPhrase = randPhrase50.nextInt(array50.length - 1);
Inside an if statement, I have this:
if (randomCropPercentage < 50){
mTheMessage.setText(array50(randPhrase));
//etc
But I know I am not doing it right because I get the error:
The method array50(int) is undefined for the type MAIN
Any ideas?