Android-运行时权限

由于拨打电话数据用户的隐私,再者由于在5.0之后Android更注重于用户的隐私权限,为此出现了在低版本没有的问题,而在高版本出现的个别问题!

   Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:"
                    + "4008109899")); startActivity(intent);
  • 1
  • 2
  • 3
  • 4

Missing permission required by intent Intent.ACTION_cALL; android.permission.CALL ErrorException!

发现在Android 5.0之后启动的格式必须是显示的不能使用隐示启动!

之后根据一些相关的查阅和浏览将其改为显示启动即可! 
在这里我们还是模拟拨打电话的事例

   Intent intent = new Intent();
   intent.setAction(Intent.ACTION_CALL);
   intent.setData(Uri.parse("tel:" + "4008109899")); startActivity(intent);

猜你喜欢

转载自www.cnblogs.com/hustcser/p/9247892.html