Details
Description
Device: Samsung galaxy s7
Android: 7.0
Cannot open file in default app which application downloaded to internal storage. This file can be opened if you navigate to it with any 3rdparty file explorer.
Getting the following error:
W System.err: android.os.FileUriExposedException: file:///storage/emulated/0/Documents/....book.pdf exposed beyond app through Intent.getData() W System.err: at android.os.StrictMode.onFileUriExposed(StrictMode.java:1799) W System.err: at android.net.Uri.checkFileUriExposed(Uri.java:2346) W System.err: at android.content.Intent.prepareToLeaveProcess(Intent.java:9526) W System.err: at android.content.Intent.prepareToLeaveProcess(Intent.java:9484) W System.err: at android.app.Instrumentation.execStartActivity(Instrumentation.java:1525) W System.err: at android.app.Activity.startActivityForResult(Activity.java:4389) W System.err: at android.app.Activity.startActivityForResult(Activity.java:4348) W System.err: at android.app.Activity.startActivity(Activity.java:4672) W System.err: at android.app.Activity.startActivity(Activity.java:4640) W System.err: at org.qtproject.qt5.android.QtNative.openURL(QtNative.java:157)
seems like we should use new android API (FileProvider):
https://developer.android.com/training/secure-file-sharing/setup-sharing.html
Attachments
Issue Links
- relates to
-
QTBUG-85232 Use Gradle for building Qt for Android
- Open
- resulted in
-
QTBUG-85238 Use FileProvider for OpenUrl() for Android
- Closed