efontana

Untitled

Sep 15th, 2011
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.66 KB | None | 0 0
  1.   void yesConfirm(object s, DialogClickEventArgs e)
  2.     {
  3.       Toast.MakeText(this, "Confirmed to proceed!", ToastLength.Short).Show();
  4.     }
  5.  
  6.     void noConfirm(object s, DialogClickEventArgs e)
  7.     {
  8.       Toast.MakeText(this, "Cancelled!", ToastLength.Short).Show();
  9.     }
  10.  
  11.  
  12.     void btnAllow_Click(object sender, EventArgs e)
  13.     {
  14.       AlertDialog.Builder builder = new AlertDialog.Builder(this);
  15.  
  16.       builder.SetMessage("Are you sure?");
  17.       builder.SetCancelable(false);
  18.  
  19.       builder.SetPositiveButton("yes", yesConfirm);
  20.       builder.SetNegativeButton("no", noConfirm);
  21.  
  22.       AlertDialog alert = builder.Create();
  23.       alert.Show();
Advertisement
Add Comment
Please, Sign In to add comment