Created
August 27, 2014 15:19
-
-
Save j-onathan/0e6c5cfb07bcae9b82c0 to your computer and use it in GitHub Desktop.
Android Code Example: AlertDialog.Builder (from https://www.codota.com/android/scenarios/52fcbca3da0a5075335da445/android.app.AlertDialog.Builder?tag=dragonfly)
This file contains hidden or 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
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