xamarin 与php,C#_c#使用xamarin编写拨打电话程序,xamarin 可以很方便的编写一个 – phpStudy…

  • Post author:
  • Post category:php


c#使用xamarin编写拨打电话程序

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

};

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

JavaScript实现图片滑动切换的代码示例分享

扩展Hibernate使用自定义数据库连接池的方法

Ubuntu VirtualBox在工作区中快捷切换实现方法

Linux中控制文件权限修改的chgrp和umask命令用法

Win10预览版10547:专业版也用上聚焦锁屏

.Net页面局部更新引发的思考

VirtualBox安装64位系统报错的处理方法

Linux常用网络工具之路由扫描工具traceroute使用介绍

Win10系统操作中心开关呈灰色无法打开的解决方法

跟我学习javascript的定时器

实例讲解Android应用开发中Fragment生命周期的控制

php ci框架中加载css和js文件失败的解决方法

C# yield在WCF中的错误用法(一)

html5-websocket基于远程方法调用的数据交互实现