配列[1]をリンクしてアクティビティを開始しようとしましたが、この行にエラーが表示されています
インテントi1 =新しいインテント(this、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();
こんにちは、あなたの解決策を得ましたか? –