Can an Android Service have multiple Permissions?

后端 未结 1 1350
执念已碎
执念已碎 2020-12-11 02:47

I have a service which both downloads a file and saves it, and it seems I can only specify one permission.



        
1条回答
  •  [愿得一人]
    2020-12-11 03:22

    An Android Service can have multiple permissions, but permissions are granted at the application level, not at the Service level.

    Your problem is that you are trying to grant permission to your Service in the wrong place in the AndroidManifest.xml file.

    The android:permission attribute of a Service specifies the permission that an entity must have to use the service, not a permission granted to the Service.

    You grant permissions to all components your application at the top level of your AndroidManifest.xml:

    
    
        
        
    
    
    

    0 讨论(0)
提交回复
热议问题