的android:如何通过Android应用程序拨打的号码
问题描述:
可能重复:
how to make phone call using intent in android?的android:如何通过Android应用程序拨打的号码
请给我的代码,通过Android应用程序呼叫的号码。
非常感谢
答
Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:123456789"));
startActivity(callIntent);
编辑:必须添加在清单<uses-permission android:name="android.permission.CALL_PHONE" />
为好。
答
试试这个,
Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:123456789"));
startActivity(callIntent);
记住这个CALL_PHONE
权限添加到您的manifest.xml
:
<uses-permission android:name="android.permission.CALL_PHONE" />
这可能帮助你。
必须在Manifest中添加' '。 –
Mika
2013-01-28 07:14:47