進出口試圖連接起來,陣列[1]發動活性,但其示出了我一個錯誤在這條線
意圖I1 =新意圖(此,Difficulty.class);如果有任何人看到這裏我去錯了請幫我
錯誤寫着「構造意圖(新DialogInterface.OnClickListener(){},類)是未定義」鏈接按鈕以啓動活動
final CharSequence[] items = {"Red", "Green", "Blue"};
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("Pick a color");
builder.setItems(items, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int item) {
if ("Green".equals(items[1]))
{Intent intent = new Intent();
Intent i1 = new Intent(this, Diff.class);
startActivity(i1);;}
}
}).show();
AlertDialog alert = builder.create();
嗨,你有你的解決方案嗎? – 2012-03-06 19:20:17