私の英語でごめんなさい!次のようなコードがあります。
public void onClick(View v) {
String imgName="";
// TODO Auto-generated method stub
switch (v.getId()) {
case R.id.button1:{
Random rand = new Random();
int rndInt = rand.nextInt(24) + 1;
imgName = "img" + rndInt;
int id = getResources().getIdentifier(imgName, "drawable", getPackageName());
imageView1.setImageResource(id);
break;}
default:
break;
};
}
ランド画像の画像の説明をクリックして、新しい意図を設定するにはどうすればよいですか? それぞれに個別?サンプル: ボタンをクリックすると、ランド イメージが魚になります。それをクリックすると、text=Fish can swim! で新しいインテントが開きます。または、ランド画像は猫です。クリックすると、新しいインテントが開きます。