1. 已经在Manifest.xml中加了相关权限,运行却出现权限错误。

java.lang.SecurityException: Neither user 10081 nor current process has android.permission.PACKAGE_USAGE_STATS.


解决:去掉android:multiprocess="true"



android:multiprocess
Whether an instance of the activity can be launched into the process of the component that started it — " true" if it can be, and " false" if not. The default value is " false".

Normally, a new instance of an activity is launched into the process of the application that defined it, so all instances of the activity run in the same process. However, if this flag is set to "true", instances of the activity can run in multiple processes, allowing the system to create instances wherever they are used (provided permissions allow it), something that is almost never necessary or desirable.


更多相关文章

  1. android 编译错误--超出接口数量限制
  2. Android APK权限大全
  3. Android——导入已存在的android工程时出现红叉错误“AndroidMan
  4. Android studio 启动问题,错误
  5. Android证书创建之 keytool 错误:java.io.IOException:Incorrect
  6. Android通过源码编译apk获得系统权限
  7. Android 网络链接,不要忘记添加网络权限。
  8. android 写文件权限
  9. Android 常用权限

随机推荐

  1. 高逼格企业级MySQL数据库备份方案,原来是
  2. 【每天一题】php面试时,你是否经常被问到?
  3. 窥探redis为何会变慢
  4. 【每天一题】PHP中常用的数组操作方法笔
  5. 这些PHP考点虽然简单基础,但是很重点
  6. PHP实现财务审核通过后返现金额到客户的
  7. 强大!Nginx 配置在线一键生成“神器”
  8. 高逼格的 2 个小神器,用好了流量监控不用
  9. HTML课时表格
  10. 课程表和用户注册的作业