Android Question Can't read in-app PDF

Branko Milosevic

Active Member
Licensed User
B4X:
Sub btnGuide_click()
  
    Dim PdfIntent As Intent

    PdfIntent.Initialize(PdfIntent.ACTION_VIEW,File.DirRootExternal&"/impromptu/guide.pdf")
         PdfIntent.SetComponent("android/com.android.internal.app.ResolverActivity")
    PdfIntent.SetType("application/pdf")
    StartActivity(PdfIntent)
  
End Sub
Managed so many harder to resolve issues but not this one.

Response: Unfortunately, Document Viewer has stopped - Report, OK

Tried everything but no go. It's 2017, it's not beyond reason to expect showing PDF to a be simple task.
Any help is so welcome....just about to publish the App if I have this done.

Just to add, I am trying to get it to work down to 4.0 :)
 
Last edited:

ronell

Well-Known Member
Licensed User
Longtime User
B4X:
Dim pdfintent As Intent

    pdfintent.Initialize(pdfintent.ACTION_VIEW, "file://" & File.Combine(File.DirRootExternal & "/", "impromptu/guide.pdf"))
    pdfintent.SetComponent("android/com.android.internal.app.ResolverActivity")
    pdfintent.SetType("application/pdf")

    StartActivity(pdfintent)

or maybe the problem is in your device pdf app
 
Last edited:
Upvote 0
Top