Android开发拨打座机分机号码

来源:互联网 发布:怎么用淘宝小号发广告 编辑:程序博客网 时间:2024/04/28 03:54

Android开发拨打如:021-11111111,分机号码是1111的电话号码时,如下:

String phone = "021-11111111";

String fenPhone = "1111";

IntentphoneIntent = new Intent("android.intent.action.CALL",Uri.parse("tel:" +phone + "," + fenPhone));

startActivity(phoneIntent);


手机上拨打:10080P1W1,这里P和W分别是Auto DTMF和Wait user confirm DTMF,在Android里面没有P和W,是用,和;代替的,但功能就是P,W。

也就是说"tel:" + phone + "," + fenPhone:是自动拨打分机号码;

"tel:" + phone + ";" + fenPhone:是需要用户确认,确认之后,自动拨打分机号码


[注意]Android拨打电话号码需要加入权限在配置文件中:

<uses-permissionandroid:name="android.permission.CALL_PHONE"/>


0 0
原创粉丝点击