Builder中的Builder(android.content.Context)无法应用于(匿名android.content.DialogInterface.OnClickListener)

Aur*_*dez -2 android dialog android-dialog

我有这个问题:

\n\n
Builder\n(android.content.Context)\nin Builder\xc2\xa0cannot be applied\nto\n(anonymous android.content.DialogInterface.OnClickListener)\n
Run Code Online (Sandbox Code Playgroud)\n\n

在此代码上:

\n\n
AlertDialog ventana;\n    ventana=new AlertDialog.Builder(this).create();\n    ventana.setTitle("COBARDE");\n    ventana.setMessage("Rendidse es de debiles,a seguir jugando");\n    ventana.show();\n    ventana.setButton(8,"Confirmar", new DialogInterface.OnClickListener() {\n        public void onClick(DialogInterface dialogo1, int id) {\n            aceptar();\n        }\n        public void aceptar(){\n            AlertDialog ventana2;\n            ventana2=new AlertDialog.Builder(this).create();\n            ventana2.setTitle("puto");\n            ventana2.setMessage("Rendidse es de debiles,a seguir jugando");\n            ventana2.show();\n        }\n\n    });\n
Run Code Online (Sandbox Code Playgroud)\n\n

有人可以解决这个问题吗?我正在尝试将一个警报对话框放入另一个警报对话框中

\n

101*_*010 5

请使用(或任何您的活动名称),而不是this(传递侦听器实例)MainActivity.this