android:multiprocess

来源:互联网 发布:蚁群算法数据挖掘 编辑:程序博客网 时间:2024/05/17 19:57

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.


原创粉丝点击