Your URI is built appropriately to access the raw resource by ID, but this does not mean that all PDF readers will decide the intent using the android.resource:// URI scheme. It depends on the implementation of the PDF Reader application installed on the user device, but many people check more than just the mimeType installed in your intentions. For example, Adobe Reader will allow for any purpose with a URI file:// URI, content:// URI or no URI at all (only mimeType), but it will not be allowed for a URI that points directly to a resource.
To be as universal as possible, you must first copy any PDF file that you want to read from your resources / resources to the file system (internal or external storage, it does not matter as long as the file is created externally readable). Then pass the intent with the URI to the file instance, and you should have much better luck overall.
A quick test showed that Aldiko ONLY responds to intent with file:// URI and "application / pdf" mimeType, and not one of the other parameters that even Adobe Reader did not allow ... so there is your winner.
NTN
source share