软件拨打电话

在软件使用过程中,有客户维权,客服电话等功能,那么要怎么才可以通过软件实现拨打电话功能呢?

拨打电话分为主动拨打电话和强制性弹出拨打电话

 

步骤1、在需要使用拨打功能的方法里写以下代码:Intent in = new Intent();
                                       in.setAction(Intent.ACTION_CALL);
                                        in.setData(Uri.parse("tel:18379952049"));
                                      startActivity(in);

步骤2、在 <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="21"
         />      和

     <application
        android:allowBackup="true"
        android:icon="@drawable/tou3"
        android:label="@string/app_name"
       >

 

之间

 

添加<uses-permission android:name="android.permission.CALL_PHONE"/>

 

posted @ 2017-06-02 10:34  西红柿里没有番茄  阅读(128)  评论(0)    收藏  举报