Android Question read pdf file

kreativa sas

Member
Licensed User
Hi guys, i'm trying to create a pdf from a base64 string and read id but i can't.
Here is my code:
pdf:
Base64EncodeDecodeImage.Base64StringToAnyFile(base64, File.DirInternal, "convert.pdf")
      
            Dim estensione="pdf"
            Dim uri As String="file://" & File.Combine(File.DirInternal & "/", "convert.pdf")
            Dim i As Intent
            i.Initialize(i.ACTION_VIEW, uri)
            i.SetComponent("android/com.android.internal.app.ResolverActivity")
            Select estensione
                Case "pdf"
                    i.SetType("application/pdf")
                Case "docx"
                    i.SetType("application/vnd.openxmlformats-officedocument.wordprocessingml.document")
                    'i.SetType("application/msword")
                Case "txt"
                    i.SetType("text/plain")
                Case "jpg"
                    i.SetType("image/jpg")
                Case "jpeg"
                    i.SetType("image/jpeg")
            End Select
              
            StartActivity(i)

The app opens the intent but the result is "impossible to open pdf".
Somebody can help me?

Thanks
 

DonManfred

Expert
Licensed User
Longtime User
can you post an example?
The forum-search is defect? This is asked a few times and i´m sure the search give you results.

Fileprovider is shown in the link i provided.
Also you can search for any examples using fileprovider to give you more answers.
 
Upvote 0

Similar Threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…