show
This method to create the dialog and display it on screen.
Parameters
The context to use. Usually your android.app.Application or android.app.Activity object.
The title displayed in the dialog.
The message to display.
The positiveButtonText displayed in the positive button.
The positiveListener to be invoked when the positive button of the dialog is pressed.
The negativeButtonText displayed in the negative button.
The negativeListener to be invoked when the negative button of the dialog is pressed.
The cancelListener that will be called if the dialog is canceled.
Sets whether the dialog is cancelable or not.
Example Usage:
SimpleAlertDialog.show(activity,
"title",
"message",
"OK",
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// Clicked OK.
}
},
"Cancel",
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// Clicked Cancel.
}
},
new DialogInterface.OnCancelListener() {
@Override
public void onCancel(DialogInterface dialog) {
// Canceled...
}
},
true);
This method to create the dialog and display it on screen.
Parameters
The context to use. Usually your android.app.Application or android.app.Activity object.
the resource ID of the theme against which to inflate this dialog, or 0 to use the parent context's default alert dialog theme
The title displayed in the dialog.
The message to display.
The positiveButtonText displayed in the positive button.
The positiveListener to be invoked when the positive button of the dialog is pressed.
The negativeButtonText displayed in the negative button.
The negativeListener to be invoked when the negative button of the dialog is pressed.
The cancelListener that will be called if the dialog is canceled.
Sets whether the dialog is cancelable or not.