Android Question PDF VIEW INTENT FAIL WITH API 24 or major

Gianni Sassanelli

Active Member
Licensed User
Longtime User
Hi for show pdf befor api 24 i have used this code:
B4X:
Dim iPdf      As Intent 
Dim folder   As String
folder=File.DirRootExternal & "/.PDF"
Dim filename As String
Filename = MyPDF.PDF
iPdf.Initialize(ii.ACTION_VIEW, ( "file://" & File.Combine(folder, filename)))
' i have tried also with
' iPdf.Initialize(ii.ACTION_VIEW, ( "content://" & File.Combine(folder, filename)))


iPdf.SetType("application/pdf")
'iPdf.WrapAsIntentChooser("Choose PDF Viewer")
StartActivity(iPdf)

now this code don't work
any help please?
thanks
 

Gianni Sassanelli

Active Member
Licensed User
Longtime User
Thank's Erel
i have just solved.
But i have a question.
the FileProvider clear the file after used it?
is there a way to clean up every file used by fileprovider?
thank's
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0
Top