How to send data to an AlertDialog [duplicate]
问题 This question already has answers here : How to pass data from a fragment to a dialogFragment (3 answers) Closed 4 years ago . I'm want to send some data to an altert dialog, to know identify winner player in my game. Here is the code in my MainActivity.java: if (game.comprobarCuatro(Game.JUGADOR)) { dibujarTablero(); resultadoTextView.setText(R.string.gana_humano); new AlertDialogFragment().show(getFragmentManager(),"ALERT DIALOG"); return; } And here is my code in AlertDialogFragment.java,