1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

Save the settings in more cases to avoid losing setting changes (especially on Android) (#14266)

This commit is contained in:
grorp 2024-01-23 21:33:27 +01:00 committed by GitHub
parent f6ecd931dc
commit a29d3cf074
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 55 additions and 4 deletions

View file

@ -85,6 +85,17 @@ public class GameActivity extends NativeActivity {
makeFullScreen();
}
private native void saveSettings();
@Override
protected void onStop() {
super.onStop();
// Avoid losing setting changes in case the app is onDestroy()ed later.
// Saving stuff in onStop() is recommended in the Android activity
// lifecycle documentation.
saveSettings();
}
@Override
public void onBackPressed() {
// Ignore the back press so Minetest can handle it