I created an AlertDialog that shows 3 buttons in Android Studio but an error appears on the reserved word "this". In the attached image, the source code can be viewed in greater detail.
How can I solve this error?
private void muestraDialogo2() {
AlertDialog.Builder builder2 = new AlertDialog.Builder(this);
builder2.setTitle("Lista de muestra");
builder2.setMessage("Tipos de muestra");
builder2.setCancelable(false);
builder2.setPositiveButton("Imprimir todas", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
Toast.makeText(Main3Activity.this, "Imprimiendo...*", Toast.LENGTH_SHORT).show();
}
});