if(txt.equals("Apple"))
{
Toast.makeText(this, "Times up", Toast.LENGTH_SHORT).show();
AlertDialog ad = new AlertDialog.Builder(this).create();
ad.setCancelable(false); // This blocks the 'BACK' button
ad.setMessage("You win");
ad.setButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
ad.show();
}
我應該寫什麼蘋果文本與ImageView的從另一個活動
Imagview img = new(Imageview)findviewbyid(R.id.fetchimage); – QuokMoon
我也希望它在IF聲明中使用 – user3127549
@ user3127549使用startActivity獲得結果。但你的帖子我不清楚 – Raghunandan