From: Vincent Vanwaelscappel Date: Wed, 1 Jul 2015 12:06:27 +0000 (+0000) Subject: (no commit message) X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=898688ff3e685b69162095572548be0a581e0035;p=fluidbook-html5.git --- diff --git a/js/libs/fluidbook/fluidbook.js b/js/libs/fluidbook/fluidbook.js index f7cc10f0..2875571b 100644 --- a/js/libs/fluidbook/fluidbook.js +++ b/js/libs/fluidbook/fluidbook.js @@ -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; }