10-16-2024, 05:52 AM
I wanted to provide an update. I've been working with BluesBoy (who has been amazing with helping me test lots of builds), and I was able to identify a pattern: MobileSheets seemed to restart every day around 19:00 on his device. I had added logs for activity lifecycle events, and it showed that a configuration change on the device was causing MobileSheets to forcibly restart (this is the normal behavior for certain configuration changes such as the user changing the primary/active language on their device). I'm still waiting for more information from BluesBoy, but this would point to an automatic system change at 19:00, such as a "night mode" or something on the device that is changing during the night, causing MobileSheets to restart. This means I have two options:
1) It is possible to prevent some configuration changes from restarting the app by indicating that you will handle them yourself in the application configuration. I already do this for things like rotating the device - I handle it in the app instead of the app just restarting (which is the default Android behavior). Once I identify what type of configuration change is occurring, it may be possible to just indicate that I will handle it myself to prevent the restart.
2) Some configuration changes force an app restart no matter what (such as dynamic color changes which was introduced on Android 12L). In that case, I can just save some information about the last song and setlist that was loaded, and ensure that MobileSheets automatically loads the song or setlist and skips back to the previously viewed page. This won't be seamless, but it would at least prevent the need to manually load things back up.
I'll post back here once BluesBoy has helped me identify what type of configuration change is occurring. I may need to do both #1 and #2 above though, to cover all possible configuration changes.
Mike
1) It is possible to prevent some configuration changes from restarting the app by indicating that you will handle them yourself in the application configuration. I already do this for things like rotating the device - I handle it in the app instead of the app just restarting (which is the default Android behavior). Once I identify what type of configuration change is occurring, it may be possible to just indicate that I will handle it myself to prevent the restart.
2) Some configuration changes force an app restart no matter what (such as dynamic color changes which was introduced on Android 12L). In that case, I can just save some information about the last song and setlist that was loaded, and ensure that MobileSheets automatically loads the song or setlist and skips back to the previously viewed page. This won't be seamless, but it would at least prevent the need to manually load things back up.
I'll post back here once BluesBoy has helped me identify what type of configuration change is occurring. I may need to do both #1 and #2 above though, to cover all possible configuration changes.
Mike