QDesktopServices on Android



  • I have an app that downloads videos and images from my server and then opens them using an external app. Everythings works fine when opening a video (VLC is my default app). However, when opening an image (the standard Android image viewer is the default app), I get the error below. My code to open the file is:

    QDesktopServices::openUrl(QUrl::fromLocalFile("<file path>"));
    

    The error(s) are as follows:

    W/ActivityManager(  562): Permission Denial: starting Intent { act=android.intent.action.VIEW dat=file:///data/data/za.co.pt/cache/pt/milk.mp4 cmp=org.wikipedia/.settings.LicenseActivity } from ProcessRecord{1838803d 12909:za.co.pt/u0a133} (pid=12909, uid=10133) not exported from uid 10089
    W/System.err(12909): java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.VIEW dat=file:///data/data/za.co.pt/cache/pt/milk.mp4 cmp=org.wikipedia/.settings.LicenseActivity } from ProcessRecord{1838803d 12909:za.co.pt/u0a133} (pid=12909, uid=10133) not exported from uid 10089
    W/System.err(12909): 	at android.os.Parcel.readException(Parcel.java:1546)
    W/System.err(12909): 	at android.os.Parcel.readException(Parcel.java:1499)
    W/System.err(12909): 	at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:2449)
    W/System.err(12909): 	at android.app.Instrumentation.execStartActivity(Instrumentation.java:1496)
    W/System.err(12909): 	at android.app.Activity.startActivityForResult(Activity.java:3745)
    W/System.err(12909): 	at android.app.Activity.startActivityForResult(Activity.java:3706)
    W/System.err(12909): 	at android.app.Activity.startActivity(Activity.java:4016)
    W/System.err(12909): 	at android.app.Activity.startActivity(Activity.java:3984)
    W/System.err(12909): 	at org.qtproject.qt5.android.QtNative.openURL(QtNative.java:110)
    W/ActivityManager(  562): Permission Denial: starting Intent { act=android.intent.action.VIEW dat=file:///data/data/za.co.pt/cache/pt/milk.mp4 cmp=org.wikipedia/.settings.LicenseActivity } from ProcessRecord{1838803d 12909:za.co.pt/u0a133} (pid=12909, uid=10133) not exported from uid 10089
    W/System.err(12909): java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.VIEW dat=file:///data/data/za.co.pt/cache/pt/milk.mp4 cmp=org.wikipedia/.settings.LicenseActivity } from ProcessRecord{1838803d 12909:za.co.pt/u0a133} (pid=12909, uid=10133) not exported from uid 10089
    W/System.err(12909): 	at android.os.Parcel.readException(Parcel.java:1546)
    W/System.err(12909): 	at android.os.Parcel.readException(Parcel.java:1499)
    W/System.err(12909): 	at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:2449)
    W/System.err(12909): 	at android.app.Instrumentation.execStartActivity(Instrumentation.java:1496)
    W/System.err(12909): 	at android.app.Activity.startActivityForResult(Activity.java:3745)
    W/System.err(12909): 	at android.app.Activity.startActivityForResult(Activity.java:3706)
    W/System.err(12909): 	at android.app.Activity.startActivity(Activity.java:4016)
    W/System.err(12909): 	at android.app.Activity.startActivity(Activity.java:3984)
    W/System.err(12909): 	at org.qtproject.qt5.android.QtNative.openURL(QtNative.java:110)
    

    Does anyone know whats going wrong? I'm not sure why I'm getting the "Permission Denial" errors. The download location is the default Android download location (retrieved through QStandardPaths).


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.