Open BakedCrossiant opened 9 months ago
The issue is that Android apps can't perform arbitrary tasks when switching away from the foreground state into the background, so it's not really possible to properly save. This is why only the back button is supported for "save on exit".
It's not possible when onStop()
is called to run a snapshot saving subroutine?
IIRC last time I tried that (the Qt equivalent is reacting to state == Qt.ApplicationSuspended
), it didn't really work. It might be worth it to try again.
Can you react to applicationStateChanged
or onAboutToQuit
instead in Qt?
Yes, that's what I did.
When Android closes the app for power management purposes, there is no snapshot saved. For some reason this also causes the loss of files in the documents folder, aside from the Scratchpad.