]> _ Git - fluidbook-html5.git/commitdiff
wip #1023 @2
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 2 Feb 2017 15:28:22 +0000 (16:28 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 2 Feb 2017 15:28:22 +0000 (16:28 +0100)
js/libs/fluidbook/fluidbook.js

index 4e2a01b9e1263bc623957d8b9fa887b43ff687f4..cfd4be830afa13f46002a9b76e0d414cf82c0acf 100644 (file)
@@ -1298,22 +1298,25 @@ Fluidbook.prototype = {
                 return true;
             }
         }
+
         if (this.datas.phonegap == 'android') {
             if (types_android[type] != undefined) {
                 this.displayLoader();
                 window.requestFileSystem(LocalFileSystem.TEMPORARY, 0, function (fileSystem) {
                     var dest = fileSystem.root;
                     window.resolveLocalFileSystemURL(url, function (entry) {
-                        entry.copyTo(dest, 'document.pdf', function (copyEntry) {
-                            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);
-                            });
+                        window.resolveLocalFileSystemURL(cordova.file.externalDataDirectory, function (dirEntry) {
+                            entry.copyTo(dirEntry, 'document.pdf', function (copyEntry) {
+                                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);
                 }, lazy);