机器人:如何通过Android应用程序拨打的号码机器人、应用程序、号码、Android

2023-09-06 13:10:15 作者:那伤╮耀眼德美

可能重复:   如何在Android中使用意向做电话?

请给我code,通过Android应用程序使用的电话号码。

多谢

解决方案

 意图callIntent =新的意图(Intent.ACTION_CALL);
callIntent.setData(Uri.parse(电话:123456789));
startActivity(callIntent);
 

修改:必须添加<使用-权限的Andr​​oid:名称=android.permission.CALL_PHONE/> 的清单,以及

小小机器人带来的改变 Android系统解析

Possible Duplicate: how to make phone call using intent in android?

Please give me code for calling the number through android Application.

Thanks a lot

解决方案

Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:123456789"));
startActivity(callIntent);

Edit: Must add <uses-permission android:name="android.permission.CALL_PHONE" /> in Manifest as well.