Help strange android system behavior if application is running more than ~8 hours


Feb 2, 2021
im currently building a digital signage app, which is running on displays which are based on android 7.*. Everything is working perfectly, except a weird OS behavior:

After a while (6-9h) of running the app, android minimizes my application, i don't get any error logs nor do i get a exception thrown.

My workaround solution is that im reopening the app every 2 hours, this is working fine, but its not what it should be.

I already tried it with WakeLock, Keep alive, Kiosk Mode, nothing seems to be working.

Does anyone have a idea how i could solve this android behavior?

I am getting pretty frustratet. PLS help
Have you changed the battery optimization setting?
It should be off for anything you want to continuously run.

Also, you can try pinning the app in your recents.

Try the battery optimization first.