You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Android 13(API33)升级后开机自启MainActivity失败问题

Android 13(API 33)开机自启无法启动MainActivity问题

我开发的一款应用最初基于Android 8.1(API 27),原本支持开机自启功能。现在尝试适配到Android 13(API 33),但开机自启功能失效了。之前用Stack Overflow里开机自启的旧方法,在新版本里不再生效;试过AlarmManager和WorkManager也没解决问题。

目前应用可以正常接收RECEIVE_BOOT_COMPLETED广播,BootForegroundService也能正常启动,但MainActivity被阻止启动,以下是Logcat输出:

2025-02-03 13:42:23.140  1985-1985  ServerDebug             dk.wk.abainfovarsling                I  onReceive called - Intent: android.intent.action.BOOT_COMPLETED
2025-02-03 13:42:23.140  1985-1985  ServerDebug             dk.wk.abainfovarsling                I  Boot completed - starting BootForegroundService.
2025-02-03 13:42:23.208  1985-1985  ServerDebug             dk.wk.abainfovarsling                I  BootForegroundService started - scheduling MainActivity launch.
2025-02-03 13:42:26.212  1985-1985  ServerDebug             dk.wk.abainfovarsling                I  Scheduling MainActivity launch using AlarmManager.
2025-02-03 13:42:26.219  1985-1985  ServerDebug             dk.wk.abainfovarsling                I  MainActivity scheduled to launch in 5 sec.

内容的提问来源于stack exchange,提问作者XerXeX

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.14 14:46:05