From 55784b0c384430e91a1c4601589c413c032cc0d5 Mon Sep 17 00:00:00 2001 From: Ramesh Ravone Date: Sun, 15 Oct 2017 10:35:13 +0530 Subject: export onBackPress for Android Module --- platform/android/java/src/org/godotengine/godot/Godot.java | 10 +++++++++- platform/android/java/src/org/godotengine/godot/GodotView.java | 8 +------- 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'platform') diff --git a/platform/android/java/src/org/godotengine/godot/Godot.java b/platform/android/java/src/org/godotengine/godot/Godot.java index 053dfa631a..59fefc498f 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 @@ -767,9 +768,16 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC */ @Override public void onBackPressed() { + boolean shouldQuit = true; + + for(int i=0;i