[英]Unable to start service after restart on android pie
我有一个应用程序即使在为此重新启动设备后也在后台连续运行服务,我在下面使用了接收器,
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.QUICKBOOT_POWERON" />
<action android:name="com.htc.intent.action.QUICKBOOT_POWERON" />
<action android:name="android.intent.action.LOCKED_BOOT_COMPLETED" />
在 Android Oreo 之前它工作正常但在 Android Pie 中,直到手机解锁,服务才开始。
重启手机后启动服务需要解锁。
重启后不解锁手机启动服务有什么解决办法
我相信你正在寻找
<action android:name="android.intent.action.LOCKED_BOOT_COMPLETED"/>
并在清单中添加到您的接收器:
android:directBootAware="true"
此操作由设备在用户重启手机解锁之前发送。 查看:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.