close

//啟動撥打電話程式
Intent intentDial = new Intent("android.intent.action.CALL",Uri.parse("tel:0982924183"));
startActivity(intentDial);

 

//新增權限  AndroidManifest.xml 加入

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="ecodesign.qcall">

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<!-- 播號的權限 -->
<uses-permission android:name="android.permission.CALL_PHONE"/>

</manifest>

 

arrow
arrow
    全站熱搜

    stockwfj3 發表在 痞客邦 留言(0) 人氣()