我从 logcat 收到以下消息:
08-16 11:34:36.257: W/BroadcastQueue(1040):
Unable to launch app com.abc.xyz/10192 for broadcast Intent
{ act=android.intent.action.BOOT_COMPLETED flg=0x8000010 (has extras) }: process is not permitted to autostart
Run Code Online (Sandbox Code Playgroud)
我的manifest.xml看起来像这样:
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<receiver android:name="com.abc.xyz.BootComplete" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter>
</receiver>
Run Code Online (Sandbox Code Playgroud)
我尝试了很多方法,但都不起作用。我知道还有其他问题。谢谢。
在小米上,默认情况下,您的应用程序将被阻止在重新启动时自动启动(与允许运行的 Facebook 或 Whatsapp 不同)。作为用户,您可以在内置安全应用程序中的“管理应用程序”->“自动启动”中更改此限制。作为一名开发人员,我没有找到答案。