1

Hy all!

I've tried a lot of things but nothing worked.

Situation: I'm downloading a PDF file (Location: /storage/sdcard0/MyFolder).

onDownloadFinished - I'm opening the .pdf.

It's working on Windows - without any problems.

It's working on Android with Adobe Reader.

But without Adobe Reader - it's not working on Android. And I don't know why.

DownloadRequestedFile( requestParam, PersistentData::LOCAL_FILE_PATH, [](){

    QDesktopServices::openUrl( QUrl::fromLocalFile( PersistentData::LOCAL_FILE_PATH ) );
});

This is the CommandLine which should open the file

Here's the error Log

E/AndroidRuntime(24835): FATAL EXCEPTION: Thread-1269
E/AndroidRuntime(24835): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=file:///storage/sdcard0/MyFolder/MyPDF.pdf }
E/AndroidRuntime(24835):    at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1545)
E/AndroidRuntime(24835):    at android.app.Instrumentation.execStartActivity(Instrumentation.java:1416)
E/AndroidRuntime(24835):    at android.app.Activity.startActivityForResult(Activity.java:3351)
E/AndroidRuntime(24835):    at android.app.Activity.startActivityForResult(Activity.java:3312)
E/AndroidRuntime(24835):    at android.app.Activity.startActivity(Activity.java:3522)
E/AndroidRuntime(24835):    at android.app.Activity.startActivity(Activity.java:3490)
E/AndroidRuntime(24835):    at org.qtproject.qt5.android.QtNative.openURL(QtNative.java:115)
E/AndroidRuntime(24835):    at dalvik.system.NativeStart.run(Native Method)

Maybe someone is able to help me or give me a hint? :)

Steve
  • 19
  • 3

1 Answers1

0

Maybe it is as simple as described in error message:

No Activity found to handle Intent

So without Adobe Reader installed there is not another application which can show pdf files. Thare is also related discusion here:

Android: Activity not found exception on some devices, when trying to open local HTML - file in browser

In this case you have to use QAndroidJniObject:: methods.

And another one solution - there is permissions problem detected:

https://forum.qt.io/topic/44859/solved-qt-on-android-open-an-external-file

Community
  • 1
  • 1