Added nativeGetHintBoolean for Java code

This commit is contained in:
Sam Lantinga
2021-11-15 16:52:54 -08:00
parent 9ec2b35147
commit be5b4d980d
2 changed files with 21 additions and 2 deletions

View File

@@ -499,8 +499,8 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
// If we do, the normal hardware back button will no longer work and people have to use home,
// but the mouse right click will work.
//
String trapBack = SDLActivity.nativeGetHint("SDL_ANDROID_TRAP_BACK_BUTTON");
if ((trapBack != null) && trapBack.equals("1")) {
boolean trapBack = SDLActivity.nativeGetHintBoolean("SDL_ANDROID_TRAP_BACK_BUTTON", false);
if (trapBack) {
// Exit and let the mouse handler handle this button (if appropriate)
return;
}
@@ -803,6 +803,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
public static native void onNativeSurfaceChanged();
public static native void onNativeSurfaceDestroyed();
public static native String nativeGetHint(String name);
public static native boolean nativeGetHintBoolean(String name, boolean default_value);
public static native void nativeSetenv(String name, String value);
public static native void onNativeOrientationChanged(int orientation);
public static native void nativeAddTouch(int touchId, String name);