打电话主要代码(意图用法)

Intent intent=new Intent();//创建意图

intent.setAction(Intent.ACTION_CALL);//设置意图做什么,括号也可是是ACTION_DIAL,两种拨号方式不一样

intent.setData(Uri.parse("tel:"+number));//注意:tel是小写  设置意图做什么的数据

startActivity(intent);//开始意图

后面要设置打电话的权限

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

原文地址:https://www.cnblogs.com/zzw1994/p/4884632.html