Created
November 18, 2012 22:19
-
-
Save jheerman/4107842 to your computer and use it in GitHub Desktop.
Mono for Android Alert Dialog Example
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
var builder = new AlertDialog.Builder(this); | |
builder.SetTitle ("Test"); | |
builder.SetIcon (Resource.Drawable.Icon); | |
builder.SetMessage ("Click a button"); | |
builder.SetPositiveButton ("Yes", (sender, e) => { | |
Toast.MakeText (this, "You clicked positive button", ToastLength.Short).Show (); | |
}); | |
builder.SetNegativeButton ("No", (sender, e) => { | |
Toast.MakeText (this, "You clicked negative button", ToastLength.Short).Show (); | |
}); | |
builder.SetNeutralButton ("Maybe", (sender, e) => { | |
Toast.MakeText(this, "You clicked neutral button", ToastLength.Short).Show (); | |
}); | |
var dialog = builder.Create (); | |
dialog.Show (); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment