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:
parent
f6ecd931dc
commit
a29d3cf074
4 changed files with 55 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue