My App downloads a PDF then using FileProvider it uses share to open the PDF. But the list applications offered does not include any pdf viewers which are installed on the device.
How can I show the PDF apps to select.
I have added to my Manifest
Then my app is as follows
When executed I get the list below to choose from no pdf applications in list.
How can I show the PDF apps to select.
I have added to my Manifest
B4X:
AddApplicationText(
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="$PACKAGE$.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths"/>
</provider>
)
CreateResource(xml, provider_paths,
<files-path name="name" path="shared" />
)
Then my app is as follows
B4X:
If job1.Success Then
Dim out As OutputStream = File.OpenOutput(Starter.Provider.SharedFolder, fname, False)
File.Copy2(job1.GetInputStream, out)
out.Close
ProgressDialogHide
If foMenu.IsInitialized Then
If foMenu.MenuIsVisible Then
foMenu.HideFan
End If
End If
Log("file://" & Starter.Provider.SharedFolder & "/" & fname)
Dim in As Intent
in.Initialize(in.ACTION_SEND, "")
in.SetType("application/pdf")
in.PutExtra("android.intent.extra.STREAM", Starter.Provider.GetFileUri(fname))
in.Flags = 1 'FLAG_GRANT_READ_URI_PERMISSION
StartActivity(in)
End If
When executed I get the list below to choose from no pdf applications in list.