Browse Source

Revert "Fix the Android implementation to return a file path, not an Uri path"

I was actually wrong on this.

Fixes #15

my problem i was having is you can't do new File(uri) but it's normal, it's not a file path, it's a Uri,
if you are sure you have a file uri, you can do new File(Uri.parse(uri).getPath()) but I guess best is to get a input stream from the Uri or keep using Uri..

This reverts commit a85cf9629a.
Gaëtan Renaudeau 8 years ago
parent
commit
70318c2c22
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      android/src/main/java/fr/greweb/reactnativeviewshot/ViewShot.java

+ 2
- 1
android/src/main/java/fr/greweb/reactnativeviewshot/ViewShot.java View File

@@ -67,7 +67,8 @@ public class ViewShot implements UIBlock {
67 67
             if ("file".equals(result)) {
68 68
                 os = new FileOutputStream(output);
69 69
                 captureView(view, os);
70
-                promise.resolve(output.getAbsolutePath());
70
+                String uri = Uri.fromFile(output).toString();
71
+                promise.resolve(uri);
71 72
             }
72 73
             else if ("base64".equals(result)) {
73 74
                 os = new ByteArrayOutputStream();