Created
November 11, 2016 19:46
-
-
Save tassioauad/53051536fbad1c293b104683e9afff31 to your computer and use it in GitHub Desktop.
DialogFragment/AlertDialog dismiss automatically on click button
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void onResume() { | |
super.onResume(); | |
AlertDialog alertDialog = (AlertDialog) getDialog(); | |
Button okButton = alertDialog.getButton(AlertDialog.BUTTON_POSITIVE); | |
okButton.setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View v) { | |
// Do your stuff here | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment