Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Android™ Runtime Development

Reply
Visitor
dtomek
Posts: 1
Registered: ‎12-12-2013
My Device: BB10
My Carrier: Android Runtime

Intent for starting new pdf

[ Edited ]

Hi! Im using code:

 

Intent intent = new Intent();
intent.setType("application/pdf");
intent.setData(Uri.parse(t));
getContext().startActivity(intent);

 

to open some file in Adobe Reader. However i get info Action not supported. How can i do this?

Please use plain text.
Regular Contributor
mja1986
Posts: 53
Registered: ‎08-27-2013
My Device: none
My Carrier: none

Re: Intent for starting new pdf

[ Edited ]

Hello,

 

same Problem here, from what I understand (https://developer.blackberry.com/android/apisupport/unsupported_api_jellybean_intents.html) Intent.ACTION_VIEW is not supported.

What are my alternatives assuming I don't want to incorporate a full blown PDF reader into my app? (Since there are seemingly no suitable open source PDF readers out there this isn't an option)

 

Thanks

 

P.S.: I actually don't require to use Adobe Reader, I'd prefere the users default PDF reader, but any decent reader will do.

Please use plain text.
Regular Contributor
mja1986
Posts: 53
Registered: ‎08-27-2013
My Device: none
My Carrier: none

Re: Intent for starting new pdf

Since there hasn't been any answer yet, I think its safe to assume that this is either not possible or there's no known solution to this problem.

 

We resorted to using pdfjs inside a WebView, just a hint if you've got the same problem...

Please use plain text.
BlackBerry Development Advisor
bbenninger
Posts: 130
Registered: ‎04-19-2013
My Device: BlackBerry Z10

Re: Intent for starting new pdf

Perhaps this will help.  Here's what we have registered to launch the native adobe reader / docstogo

 

        <activity android:name="PdfFileViewer" android:icon="@drawable/adobereader"
                  android:theme="@android:style/Theme.Translucent">
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:mimeType="application/pdf" />
            </intent-filter>
        </activity>
        <activity android:name="DocsToGoFileViewer" android:icon="@drawable/docstogo"
                  android:theme="@android:style/Theme.Translucent">
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <!-- from sys.dxtg.wtg.gYABgKH0JhT7tasXrfXUyNxNaew bar-descriptor.xml -->
                <data android:mimeType="application/msword" />
                <data android:mimeType="text/plain" />
                <data android:mimeType="application/vnd.openxmlformats-officedocument.wordprocessingml.document" />
                <data android:mimeType="application/vnd.openxmlformats-officedocument.wordprocessingml.template" />
                <data android:mimeType="application/vnd.ms-word.document.macroEnabled.12" />
                <data android:mimeType="application/vnd.ms-word.template.macroEnabled.12" />
                <!-- from sys.dxtg.sstg.gYABgLhf.C6ER6tWA.ObKMKalQU bar-descriptor.xml -->
                <data android:mimeType="application/vnd.ms-powerpoint" />
                <data android:mimeType="application/vnd.openxmlformats-officedocument.presentationml.presentation" />
                <data android:mimeType="application/vnd.openxmlformats-officedocument.presentationml.template" />
                <data android:mimeType="application/vnd.openxmlformats-officedocument.presentationml.slideshow" />
                <data android:mimeType="application/vnd.ms-powerpoint.presentation.macroEnabled.12" />
                <data android:mimeType="application/vnd.ms-powerpoint.template.macroEnabled.12" />
                <data android:mimeType="application/vnd.ms-powerpoint.slideshow.macroEnabled.12" />
                <!-- from sys.dxtg.stg.gYABgKF.gjTVTclxOrZ0RRQcoTc bar-descriptor.xml -->
                <data android:mimeType="application/vnd.ms-excel" />
                <data android:mimeType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" />
                <data android:mimeType="application/vnd.openxmlformats-officedocument.spreadsheetml.template" />
                <data android:mimeType="application/vnd.ms-excel.sheet.macroEnabled.12" />
                <data android:mimeType="application/vnd.ms-excel.template.macroEnabled.12" />
            </intent-filter>
        </activity>

Please use plain text.