diff options
author | Fredia Huya-Kouadio <fhuyakou@gmail.com> | 2021-04-12 16:48:35 -0700 |
---|---|---|
committer | Fredia Huya-Kouadio <fhuyakou@gmail.com> | 2021-04-12 16:48:35 -0700 |
commit | 1f16ba26961f4c5ca1ec2a0665cd2d675c34e8f7 (patch) | |
tree | 61b06be621ac4030f9b7607afcd689770ad24be9 /platform/android/java/lib/src | |
parent | 8793a464d312c5a48490fbec03c26f2835318063 (diff) |
Add support for forwarding callbacks from Godot's parent activity.
Diffstat (limited to 'platform/android/java/lib/src')
-rw-r--r-- | platform/android/java/lib/src/org/godotengine/godot/FullScreenGodotApp.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/platform/android/java/lib/src/org/godotengine/godot/FullScreenGodotApp.java b/platform/android/java/lib/src/org/godotengine/godot/FullScreenGodotApp.java index 4eac2d08d1..1ed16e04ca 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/FullScreenGodotApp.java +++ b/platform/android/java/lib/src/org/godotengine/godot/FullScreenGodotApp.java @@ -34,6 +34,7 @@ import android.content.Intent; import android.os.Bundle; import android.view.KeyEvent; +import androidx.annotation.CallSuper; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.fragment.app.FragmentActivity; @@ -68,6 +69,24 @@ public abstract class FullScreenGodotApp extends FragmentActivity implements God } } + @CallSuper + @Override + public void onActivityResult(int requestCode, int resultCode, Intent data) { + super.onActivityResult(requestCode, resultCode, data); + if (godotFragment != null) { + godotFragment.onActivityResult(requestCode, resultCode, data); + } + } + + @CallSuper + @Override + public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) { + super.onRequestPermissionsResult(requestCode, permissions, grantResults); + if (godotFragment != null) { + godotFragment.onRequestPermissionsResult(requestCode, permissions, grantResults); + } + } + @Override public void onBackPressed() { if (godotFragment != null) { |