Dynamic AndroidManifest.xml

2019-05-07 21:51发布

Is it possible to dynamically define aspects of the AndroidManifest.xml? For example, is it possible to register or edit the definition of activities, services and receivers on the fly, using Java code?

If so, are there any limitations on where this code should be placed? What else can be dynamically defined?

1条回答
看我几分像从前
2楼-- · 2019-05-07 22:33

I believe most of the available operations are described by the PackageManager documentation

You can add and remove permissions (addPermission()) and you can enable or disable components (services, receivers etc.) with setComponentEnabledSetting().

查看更多
登录 后发表回答