I wrote an Android app, originally developed on Android 8.1 API 27. The App opens on boot. Now i'm trying to update the app to be compatible with Android 13 API 33, but i can not get the app to start on boot. Originally i used the method in this post How to start/ launch application at boot time Android but this does not work in the new version. I have tried using "AlarmManager" and "WorkManager" but have not managed to get it to work.
I do receive "RECEIVE_BOOT_COMPLETED" and the foregroundService starts, but the MainActivity is blocked from starting. Here is let Logcat output.
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.
I wrote an Android app, originally developed on Android 8.1 API 27. The App opens on boot. Now i'm trying to update the app to be compatible with Android 13 API 33, but i can not get the app to start on boot. Originally i used the method in this post How to start/ launch application at boot time Android but this does not work in the new version. I have tried using "AlarmManager" and "WorkManager" but have not managed to get it to work.
I do receive "RECEIVE_BOOT_COMPLETED" and the foregroundService starts, but the MainActivity is blocked from starting. Here is let Logcat output.
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.
I do receive "RECEIVE_BOOT_COMPLETED" and the foregroundService starts, but the MainActivity is blocked from starting
Background activity starts have been banned for several years except in limited scenarios.
I have tried using "AlarmManager" and "WorkManager" but have not managed to get it to work.
Those would also qualify as banned background activity starts.
i'm trying to update the app to be compatible with Android 13 API 33, but i can not get the app to start on boot
Have your app be the designated launcher (<intent-filter>
for the MAIN
action and HOME
category).