Bringing down service while still waiting for start foreground

1.如果是第三方应用,未加系统权限,则会报错,不能在后台启动service,解决方案在网上有一篇详解,但是自测还是有问题,暂时留下连接后续慢慢研究。

https://blog.csdn.net/qq_33649832/article/details/87880455

2.作为系统应用,是有权限后台启动service的,所以加上android:sharedUserId="android.uid.system"获取系统权限,设置为系统级进程,再对apk进行系统签名。

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:sharedUserId="android.uid.system"
    package="com.incall.apps.fotatest">

 

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐