こんにちは友人2つの状況がありますが、ランダムにしたいのですが。ユーザーがボタンをクリックすると、2つの状況case0またはcase1がランダムに変更されます。だから、テキストのは、ランダムにランダムに切り替える場合
Random rand = new Random();
int newrand = rand.nextInt(1) + 1;
switch(newrand) {
case 0:
text1.setText(lastImageName);
text2.setText(lastImageName2);
break;
case 1:
text1.setText(lastImageName2);
text2.setText(lastImageName);
break;
}
しかし、それは...ランドは何時々働いていない...あまりにも...
* lastImageNameとlastImageName2が可変の文字列で変更されています。問題?