Android打电话的三种方式

来源:互联网 发布:货运单打印软件 编辑:程序博客网 时间:2024/06/02 03:51

1 直接拨打电话, 注意 : 如果应用中存在这种方式的话, 在豌豆荚上线就会有一个隐私提示的图标

String number = "123456789";Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + number));startActivity(intent);

2 跳转到拨号界面, 不传递电话号码

Intent intent = new Intent(Intent.ACTION_CALL_BUTTON);startActivity(intent);

3 跳转到拨号界面, 传递电话号码, 需用户自己点击拨号

String number = "123456789";Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:" + number));startActivity(intent);

上述三种方式, 看你的需求自己选择吧

0 0