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;
}