summaryrefslogtreecommitdiff
path: root/platform/android/java/src
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2014-12-16 22:33:35 -0300
committerJuan Linietsky <reduzio@gmail.com>2014-12-16 22:33:35 -0300
commitd55f95e0d2a2f99a4130a33ad542c3682d0b92db (patch)
tree5e413e2e81398254ac2e5d7421c5fd893ef537a7 /platform/android/java/src
parentbcf27feb980aec593c7cb771984e46113cfad757 (diff)
parent1664cd67101722f0955385ed6b463f534830aeed (diff)
Merge branch 'master' of https://github.com/okamstudio/godot
Diffstat (limited to 'platform/android/java/src')
-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 d149916893..ff0eb5edcc 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) {