]> _ Git - fluidbook-html5.git/commitdiff
(no commit message)
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 1 Jul 2015 12:06:27 +0000 (12:06 +0000)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 1 Jul 2015 12:06:27 +0000 (12:06 +0000)
js/libs/fluidbook/fluidbook.js

index f7cc10f0b7faec25f965b7e419144ebfcac1d5b5..2875571b840e187f15e54a7d06516db1692e9564 100644 (file)
@@ -1314,17 +1314,26 @@ Fluidbook.prototype = {
         if (this.datas.phonegap == 'android') {
             if (types_android[type] != undefined) {
                 this.displayLoader();
-                setTimeout(function () {
-                    window.plugins.webintent.startActivity({
-                        action: window.plugins.webintent.ACTION_VIEW,
-                        type: types_android[type],
-                        url: url
-                    }, function (args) {
-                        $this.hideLoader(5);
-                    }, function (args) {
-                        $this.hideLoader(5);
-                    });
-                }, 100);
+
+                window.requestFileSystem(LocalFileSystem.TEMPORARY, 0, function (fileSystem) {
+                    fb('got fs')
+                    var dest = fileSystem.root;
+                    window.resolveLocalFileSystemURI(url, function (entry) {
+                        fb('resolved')
+                        entry.copyTo(dest, 'document.pdf', function (copyEntry) {
+                            fb('copied');
+                            window.plugins.webintent.startActivity({
+                                action: window.plugins.webintent.ACTION_VIEW,
+                                type: types_android[type],
+                                url: copyEntry.toURL()
+                            }, function (args) {
+                                $this.hideLoader(5);
+                            }, function (args) {
+                                $this.hideLoader(5);
+                            });
+                        }, lazy);
+                    }, lazy);
+                }, lazy);
             }
             return true;
         }