Cannnot start PDF

Smee

Well-Known Member
Licensed User
Longtime User
I have the following code
B4X:
Dim in As Intent 
in.Initialize(in.ACTION_VIEW, FileName)
in.SetType("application/pdf")

but when the code is executed i get a quick message saying that the program has stopped unexpectedly and it reverts back to my calling program

Is there something i am missing?

I can navigate to the file and it opens ok when i click on it in its directory so the file itself is ok


UPDATE:

IF I CHANGE THE Initialize line to the following it works

in.Initialize(in.ACTION_VIEW, "file://" & File.Combine(File.DirDefaultExternal , "/Test.pdf"))

What is wrong with the first line anybody?
 
Last edited:

Smee

Well-Known Member
Licensed User
Longtime User
The filename being passed is

File.DirDefaultExternal & "/Test.pdf"
 
Upvote 0
Top