diff --git a/app/build.gradle b/app/build.gradle index 30a6769..ce0ff8d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -7,7 +7,7 @@ android { minSdkVersion 14 targetSdkVersion 26 versionCode 1 - versionName "1.0.1" + versionName "1.0.2" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { diff --git a/app/src/main/java/com/axxie/tiddlywikiandroid/ViewActivity.java b/app/src/main/java/com/axxie/tiddlywikiandroid/ViewActivity.java index 9836944..ffc5233 100644 --- a/app/src/main/java/com/axxie/tiddlywikiandroid/ViewActivity.java +++ b/app/src/main/java/com/axxie/tiddlywikiandroid/ViewActivity.java @@ -136,7 +136,9 @@ public boolean shouldOverrideUrlLoading(WebView view, String url) { if (url != null && (url.startsWith("http://") || url.startsWith("https://") || url.startsWith("content://com.axxie.fileprovider"))) { // TODO: propose download for unhandled files (e.g. bash scripts) (images should be opened ok) - view.getContext().startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url))); + Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); + intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION); + view.getContext().startActivity(intent); return true; } else { return false;