Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android background save #325

Open
BakedCrossiant opened this issue Sep 26, 2023 · 5 comments
Open

Android background save #325

BakedCrossiant opened this issue Sep 26, 2023 · 5 comments

Comments

@BakedCrossiant
Copy link

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.

@Vogtinator
Copy link
Member

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".

@BakedCrossiant
Copy link
Author

It's not possible when onStop() is called to run a snapshot saving subroutine?

@Vogtinator
Copy link
Member

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.

@BakedCrossiant
Copy link
Author

Can you react to applicationStateChanged or onAboutToQuit instead in Qt?

@Vogtinator
Copy link
Member

Yes, that's what I did.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants