From 2ba23c8ae757390ef115f56bcc41a8b5d9053eba Mon Sep 17 00:00:00 2001 From: Ramesh Ravone Date: Tue, 3 Oct 2017 11:33:37 +0530 Subject: [PATCH] Handling BackPress event [Android] --- .../java/src/org/godotengine/godot/Godot.java | 13 ++++++++++++- .../java/src/org/godotengine/godot/GodotView.java | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/platform/android/java/src/org/godotengine/godot/Godot.java b/platform/android/java/src/org/godotengine/godot/Godot.java index 2a820e90048..e6521f14b20 100644 --- a/platform/android/java/src/org/godotengine/godot/Godot.java +++ b/platform/android/java/src/org/godotengine/godot/Godot.java @@ -191,6 +191,7 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC protected void onMainPause() {} protected void onMainResume() {} protected void onMainDestroy() {} + protected boolean onMainBackPressed() { return false; } protected void onGLDrawFrame(GL10 gl) {} protected void onGLSurfaceChanged(GL10 gl, int width, int height) {} // singletons will always miss first onGLSurfaceChanged call @@ -727,9 +728,19 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC */ @Override public void onBackPressed() { + boolean shouldQuit = true; + + for(int i=0;i