Salut à tous - Dans Android, j'ai écrit un certain nombre de chaînes dans mon string.xml Je voudrais afficher sur un TextView basé sur un nombre aléatoire ... Voici ce que je ont:Affichage d'une chaîne aléatoire sur un TextView dans une mise en page
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);
Dans une instruction if, j'ai ceci:
if (randomCropPercentage < 50){
mTheMessage.setText(array50(randPhrase));
//etc
Mais je sais que je ne le fais pas juste parce que je reçois l'erreur:
The method array50(int) is undefined for the type MAIN
Des idées?