aboutsummaryrefslogtreecommitdiff
path: root/platform/android
diff options
context:
space:
mode:
authorAnton Yabchinskiy2014-12-23 23:44:07 +0300
committerAnton Yabchinskiy2014-12-23 23:44:07 +0300
commit4ab1bcde35a02cfe7b25d630720de1cc81ef5a1a (patch)
treeb476b0f4aa8df1801361a04390c98cf0e2e3d98b /platform/android
parentff755f93eb86e3f7f6801918457ca77a3001671b (diff)
parent530d717a67cc3acab10270dca700db328aa12891 (diff)
downloadgodot-4ab1bcde35a02cfe7b25d630720de1cc81ef5a1a.tar.gz
godot-4ab1bcde35a02cfe7b25d630720de1cc81ef5a1a.tar.zst
godot-4ab1bcde35a02cfe7b25d630720de1cc81ef5a1a.zip
Merge branch 'master' of github.com:okamstudio/godot
Conflicts: drivers/SCsub platform/x11/detect.py platform/x11/os_x11.h
Diffstat (limited to 'platform/android')
-rw-r--r--platform/android/java/src/com/android/godot/GodotIO.java22
1 files changed, 20 insertions, 2 deletions
diff --git a/platform/android/java/src/com/android/godot/GodotIO.java b/platform/android/java/src/com/android/godot/GodotIO.java
index d14991689..ff0eb5edc 100644
--- a/platform/android/java/src/com/android/godot/GodotIO.java
+++ b/platform/android/java/src/com/android/godot/GodotIO.java
@@ -438,8 +438,26 @@ public class GodotIO {
try {
Log.v("MyApp", "TRYING TO OPEN URI: " + p_uri);
- Intent myIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(p_uri));
- activity.startActivity(myIntent);
+ String path = p_uri;
+ String type="";
+ if (path.startsWith("/")) {
+ //absolute path to filesystem, prepend file://
+ path="file://"+path;
+ if (p_uri.endsWith(".png") || p_uri.endsWith(".jpg") || p_uri.endsWith(".gif") || p_uri.endsWith(".webp")) {
+
+ type="image/*";
+ }
+ }
+
+ Intent intent = new Intent();
+ intent.setAction(Intent.ACTION_VIEW);
+ if (!type.equals("")) {
+ intent.setDataAndType(Uri.parse(path), type);
+ } else {
+ intent.setData(Uri.parse(path));
+ }
+
+ activity.startActivity(intent);
return 0;
} catch (ActivityNotFoundException e) {