Skip to content

Instantly share code, notes, and snippets.

@j-onathan
Created August 27, 2014 15:19
Show Gist options
  • Save j-onathan/0e6c5cfb07bcae9b82c0 to your computer and use it in GitHub Desktop.
Save j-onathan/0e6c5cfb07bcae9b82c0 to your computer and use it in GitHub Desktop.
public static AlertDialog newMessageDialog(final Context context, String dialogTitle,
String screenMessage, int iconResourceId) {
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setCancelable(false);
builder.setPositiveButton("Okay", new OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
builder.setTitle(dialogTitle);
builder.setMessage(screenMessage);
builder.setIcon(iconResourceId);
return builder.create();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment