- callButton.Click += (object sender, EventArgs e) =>
- {
- // On "Call" button click, try to dial phone number. sharejs.com
- var callDialog = new AlertDialog.Builder(this);
- callDialog.SetMessage("Call " + translatedNumber + "?");
- callDialog.SetNeutralButton("Call", delegate {
- // Create intent to dial phone
- var callIntent = new Intent(Intent.ActionCall);
- callIntent.SetData(Android.Net.Uri.Parse("tel:" + translatedNumber));
- StartActivity(callIntent);
- });
- callDialog.SetNegativeButton("Cancel", delegate { });
- // Show the alert dialog to the user and wait for response.
- callDialog.Show();
- };
- //该片段来自于http://www.codesnippet.cn/detail/1709201410448.html
来源: http://www.codesnippet.cn/detail/1709201410448.html