手机
当前位置:查字典教程网 >编程开发 >C#教程 >c#使用xamarin编写拨打电话程序
c#使用xamarin编写拨打电话程序
摘要:xamarin可以很方便的编写一个电话拨号程序,下面的代码是调用android系统的拨号功能,拨号前会给出一个提示信息。callButton...

xamarin 可以很方便的编写一个电话拨号程序,下面的代码是调用android系统的拨号功能,拨号前会给出一个提示信息。

callButton是一个用来拨号的按钮,我们使用它的点击事件来进行拨号,拨号前会有一个提示框

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(); };

以上所述就是本文的全部内容了,希望大家能够喜欢。

【c#使用xamarin编写拨打电话程序】相关文章:

C#注释的一些使用方法浅谈

c# 命名空间和程序集

C# 中如何利用lambda实现委托事件的挂接

C#使用DllImport调用非托管的代码的方法

c# 二分查找算法

使用c#在word文档中创建表格的方法详解

C#利用ScriptControl动态执行JS和VBS脚本

使用VS2005自带的混淆器防止你的程序被反编译的方法

用C#编写ActiveX控件(二)

用C#写的ADSL拨号程序的代码示例

精品推荐
分类导航