' open Pdf Document
Try
Dim in As Intent
in.Initialize(in.ACTION_VIEW, "")
Starter.Provider.SetFileUriAsIntentData(in, PdfFile)
in.SetType("application/pdf")
StartActivity(in)
Catch
MsgboxAsync("It seems that there's not a Pdf viewer application in the device", "Open Document")
Wait For Msgbox_Result (Resultx As Int)
End Try
The thing is that the 'catch' segment does not execute, Android (Api 29) send a fast dissapear toast message "Please Install or Update the Addon Pdf".
For users like me that's no problem. But I'd like to take control and send a better message like, "Please Install Acrobat Reader" or something.
Is there any way to do that?
Hi, is there a way to get a list of installed apps (package names) which accept a specific intent? For instance, I would like to get the package-names of all installed apps (on a phone/tablet) that can run or handle the following intent: Intent i = new Intent("android.intent.action.VIEW")...
Dim pm As PackageManager
Dim Intent1 As Intent
Intent1.Initialize(Intent1.ACTION_VIEW, "file://")
Intent1.SetType("application/pdf")
For Each cn As String In pm.queryIntentActivities (Intent1)
Log(cn)
Next
And it returns one item: com.mixplorer/.activities.EBookReaderActivity
Its no use. No application is opened. Better if nothing is found.
If that ebookreader app doesn't handle PDF files, then my only guess is that you might need to tweak the intent a little more, or perform multiple tests with different intents and come up with some type of multi-step test to see if there are any apps that can properly open PDF files or not.
I know Android cannot handle PDFs natively. However, the Nexus One (and possibly other phones) come pre-installed with QuickOffice Viewer. How would I determine whether the user has a PDF viewer
This message comes from this app: com.mixplorer/.activities.EBookReaderActivity
You cannot catch this error as there is no error. This app is registered to handle PDF files. Whether it can actually handle them or not is a different question.