I have a kiosk mode app, and I'm trying to get it ...
# android
s
I have a kiosk mode app, and I'm trying to get it to launch at boot on API 27/28. I have a BroadcastReceiver declared in the manifest for boot completed, and it is launching my initial splash activity. However, when the splash activity goes to launch the main activity, it seems to go back to the launcher.
a
I will comment here to follow the thread, I have the same req but for lower version
s
Sounds like there is a crash, do you have logs?
a
make an intent filter respond to the home intent and set it as the home app on the kiosk device?
s
No logs, but when I have it start Main Activity instead, I get a System UI not responding dialog
s
First off, Adam's suggestion is what you should be doing here, but I also think you have a bug in Main Activity that needs to be fixed
s
Can I do it conditionally? I have some kiosk devices and some handheld devices that I'd like the app to run on, but the handheld ones don't need to be in kiosk mode
And yes, there are issues with MainActivity taking a while to load. I am working on those as well, but I'd like to get things up and running first
a
more recent versions of android explicitly do not allow starting activities from broadcasts
I forget which exact restrictions were introduced in each API level, but starting activities from BroadcastReceivers is an antipattern/abuse vector that should be avoided
if there's some activity you should be locked into at boot, that sounds like it's a home screen to me ­čÖé
s
What if I made a home screen that then launches the app? Since I also want to run the app on devices where it doesn't have to launch at boot