2011-04-05 75 views

回答

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

編輯:必須添加在清單<uses-permission android:name="android.permission.CALL_PHONE" />爲好。

+12

必須在Manifest中添加''。 – Mika 2013-01-28 07:14:47

69

試試這個,

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" /> 

這可能幫助你。

相關問題