'
Dim FileName As String = xListFile & ".PDF"
Dim provider As FileProvider
provider.Initialize
' Copy the file to the shared directory
Wait For (File.CopyAsync(oListDir, FileName, Starter.Provider.SharedFolder, FileName)) Complete (Success As Boolean)
'
If Success = False Then
Log("Android - Error: Failed to copy the file to the shared directory.")
Return
Else
Log("Android - File copy successful: " & Success)
End If
'
' Configure the Intent to open the PDF
Dim docIntent As Intent
docIntent.Initialize(docIntent.ACTION_VIEW, "")
provider.SetFileUriAsIntentData(docIntent, FileName)
docIntent.SetType("application/pdf")
docIntent.Flags = Bit.Or(1, 2) ' FLAG_GRANT_READ_URI_PERMISSION
'
StartActivity(docIntent)
'