手记

Android6.0系统后版本直接拨打电话代码

if (ContextCompat.checkSelfPermission(rootContainer.getContext(),
                Manifest.permission.CALL_PHONE)
                != PackageManager.PERMISSION_GRANTED)
        {

            ActivityCompat.requestPermissions(MainActivity.mainInstance,
                    new String[]{Manifest.permission.CALL_PHONE},
                    1);
        } else
        {
            Intent intent = new Intent(Intent.ACTION_CALL);
            Uri data = Uri.parse("tel:" + "4009201210");
            intent.setData(data);
            rootContainer.getContext().startActivity(intent);
        }
5人推荐
随时随地看视频
慕课网APP