Last active
April 11, 2020 17:03
-
-
Save ashishkudale/5e9ba5d169d5e130d5c0ea2700b57155 to your computer and use it in GitHub Desktop.
showAlertDialog helps to show dialog box with custom title,message and OnClickListener
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
private void showAlertDialog(String title, String message, String positiveButtonText, String negativeButtonText, DialogInterface.OnClickListener positiveListener, DialogInterface.OnClickListener negativeListener) { | |
AlertDialog dialog = new AlertDialog.Builder(CameraPermission.this) | |
.setPositiveButton(positiveButtonText, positiveListener) | |
.setNegativeButton(negativeButtonText, negativeListener) | |
.create(); | |
if (title != null || !title.isEmpty()) { | |
dialog.setTitle(title); | |
} | |
dialog.setMessage(message); | |
dialog.show(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment