Hi, I have been trying to open pdf files for hours after creation. On an old tablet the pdf files are displayed after creation using file: // but on a latest generation tablet it does not work. I followed a tutorial using FileProvider, and now the pdf viewer of drive opens with the name of the pdf file but the file is empty. some help
B4a:
Dim out As OutputStream = File.OpenOutput(File.DirRootExternal,"SmartCommerce/Fatture/"& LnomeAziendaSel.Text&"/"& LnomeAziendaSel.Text&id&".pdf", False)
pdf.WriteToStream(out)
out.Close
pdf.Close
ToastMessageShow("Fattura generata con successo",True)
Dim intent As Intent
intent.Initialize(intent.ACTION_VIEW,CreateFileProviderUri(Starter.shared,LnomeAziendaSel.Text &id&".pdf"))
'intent.Initialize(intent.ACTION_VIEW,"file://"&File.Combine(File.DirRootExternal, "SmartCommerce/Fatture/"& LnomeAziendaSel.Text&"/"& LnomeAziendaSel.Text &id&".pdf"))
intent.Flags = 1
intent.SetComponent("android/com.android.internal.app.ResolverActivity")
intent.SetType("application/pdf")
StartActivity(intent)