进出口试图连接起来,阵列[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