Sub Activity_Create(FirstTime As Boolean)
File.Copy(File.DirAssets,"2.pdf",Starter.Shared,"2.pdf")
Dim intent As Intent
intent.Initialize(intent.ACTION_VIEW,CreateFileProviderUri(Starter.Shared,"2.pdf"))
intent.SetType("application/pdf")
intent.WrapAsIntentChooser("Choose PDF Viewer")
StartActivity(intent)
End Sub
Sub CreateFileProviderUri (Dir As String, FileName As String) As Object
Dim FileProvider As JavaObject
Dim context As JavaObject
context.InitializeContext
FileProvider.InitializeStatic("android.support.v4.content.FileProvider")
Dim f As JavaObject
f.InitializeNewInstance("java.io.File", Array(Dir, FileName))
Return FileProvider.RunMethod("getUriForFile", Array(context, Application.PackageName & ".provider", f)) 'ERROR HERE
End Sub