From 906e993d0fb9cbf86a31b4d485b7554b20705979 Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 2 Nov 2018 19:28:55 +0000 Subject: [PATCH] Prevent crash --- app/src/main/java/eu/faircode/email/ActivityView.java | 5 ++++- app/src/main/res/values/strings.xml | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/ActivityView.java b/app/src/main/java/eu/faircode/email/ActivityView.java index 63d39d06fe..2304583fe6 100644 --- a/app/src/main/java/eu/faircode/email/ActivityView.java +++ b/app/src/main/java/eu/faircode/email/ActivityView.java @@ -897,7 +897,10 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB create.addCategory(Intent.CATEGORY_OPENABLE); create.setType(intent.getStringExtra("type")); create.putExtra(Intent.EXTRA_TITLE, intent.getStringExtra("name")); - startActivityForResult(create, REQUEST_ATTACHMENT); + if (create.resolveActivity(getPackageManager()) == null) + Snackbar.make(view, R.string.title_no_saf, Snackbar.LENGTH_LONG).show(); + else + startActivityForResult(create, REQUEST_ATTACHMENT); } private void onDecrypt(Intent intent) { diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index b72e37b1af..6018c55c12 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -195,6 +195,7 @@ No reply templates defined No viewer app available for %1$s + Storage access framework not available Attachment saved Some attachments are not downloaded and will not be forwarded, continue? Delete message permanently?