Android Question pdf view intent fails in huawei

pezhooman

Member
Licensed User
Longtime User
hi
i maked an app that show downloaded pdf with intent and it workes good in any devices i have.bet in huawei honor it get error and dont anything.intent show " choose pdf application?" but 3 apps instaled.
plz help me.


B4X:
Sub showpdf(add As String)
    Dim ii As Intent 'Requires a reference to the Phone library
     
    Dim folder   As String
    folder=File.DirRootExternal & "/.micro"
    Dim filename As String
 
    filename = add
    ii.Initialize(ii.ACTION_VIEW, ( "file://" & File.Combine(folder, filename)))
     
    ii.SetType("application/pdf")
    ii.SetComponent("android/com.android.internal.app.ResolverActivity")
    ii.WrapAsIntentChooser("Choose PDF Viewer")
 
    StartActivity(ii)
 
End Sub
 

JordiCP

Expert
Licensed User
Longtime User
It's just a guess based on what I have read, since I don't have a huawei to check it

But I have tested your code with and without that line, and the results are the same --> so, it seems that it is not necessary

I would try it and see what happens:)
 
Upvote 0
Top