user3926604
user3926604

Reputation: 189

open file using navigateToURL

I'm making an android file browser app designed with as3. I finished designing every thing now I just need a way to open a file (image, video, pdf.. etc). right now I'm using this code:

navigateToURL(new URLRequest(File.desktopDirectory.url + "/" + fileName, "_blank"));

on pc it opens the file in the default web browser but on android device it only opens the file in "google drive" app as a pdf and shows error message that the choosen file is not a pdf file and when disabling "google drive" it does nothing.
can you please tell me whats wrong? or give me a way to open a file?
I know this is a dublicate but none of other solutions worked for me.

Upvotes: 1

Views: 352

Answers (1)

user3926604
user3926604

Reputation: 189

I think the only way to do this is to use an ANE like this: https://github.com/illuzor/Android-File-Extension-ANE after downloading the zip extract it then include the ANE in the bin folder in your project then import com.illuzor.fileextension.FileExtension to your project from source_as3 folder then type

FileExtension.openFile(file);

where "file" is the file object you want to open. I tested it on adnroid device and it worked.
NOTE: you need AIR SDK 18 or latest.

Upvotes: 1

Related Questions