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 编译错误--超出接口数量限制
  3. Could not get resource ‘https://dl.google.com/dl/android/ma
  4. android获取短信验证码自动填入
  5. Android(安卓)APK权限大全
  6. android 多语言实现总结
  7. java.lang.IllegalStateException: Could not execute method fo
  8. 安卓模拟器去掉头部标题
  9. 安卓模拟器去掉头部标题

随机推荐

  1. Android(安卓)PKMS深入分析安装应用
  2. Cocos2d-x android can't resolved cosco
  3. Android传感器
  4. VLC for Android(安卓)on Linux
  5. 让背景小图不是拉伸而是多个重复
  6. Android捕获Home按键
  7. Android应用程序绑定服务(bindService)的过
  8. android:configChanges="keyboard|keyboa
  9. Android(安卓)创建,验证和删除桌面快捷方
  10. Android图形报表之AchartEngine(附开发包