我有一个应用程序,即使在重启设备后,它也会在后台连续运行服务,为此,我使用了以下接收器,
<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中,直到手机解锁,服务才会启动。
要在重启后启动服务,需要解锁电话。
重启后不解锁开机的解决方案是什么?
发布于 2019-10-06 15:02:20
我相信你要找的是
<action android:name="android.intent.action.LOCKED_BOOT_COMPLETED"/>并在清单中添加到您的接收者:
android:directBootAware="true"此操作由设备在用户重新启动时解锁其电话之前发送。查看:
https://stackoverflow.com/questions/58075954
复制相似问题