mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-12 16:58:39 +00:00
Save the settings in more cases to avoid losing setting changes (especially on Android) (#14266)
This commit is contained in:
parent
00f6bd0f08
commit
50edb30a18
4 changed files with 55 additions and 4 deletions
|
@ -80,6 +80,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