From b1e4d557d5fea920f60e1fbf3dd8bdf25a8a0d75 Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 23 Feb 2020 14:02:14 +0100 Subject: [PATCH] Fix for no SAF --- .../java/eu/faircode/email/FragmentCompose.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index e8b657b1e4..2c44e79f43 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -1334,7 +1334,7 @@ public class FragmentCompose extends FragmentBase { Helper.openAdvanced(intent); PackageManager pm = getContext().getPackageManager(); if (intent.resolveActivity(pm) == null) - Snackbar.make(view, R.string.title_no_saf, Snackbar.LENGTH_LONG).show(); + noStorageAccessFramework(); else startActivityForResult(Helper.getChooser(getContext(), intent), REQUEST_IMAGE); } @@ -1347,11 +1347,22 @@ public class FragmentCompose extends FragmentBase { Helper.openAdvanced(intent); PackageManager pm = getContext().getPackageManager(); if (intent.resolveActivity(pm) == null) - Snackbar.make(view, R.string.title_no_saf, Snackbar.LENGTH_LONG).show(); + noStorageAccessFramework(); else startActivityForResult(Helper.getChooser(getContext(), intent), REQUEST_ATTACHMENT); } + private void noStorageAccessFramework() { + Snackbar snackbar = Snackbar.make(view, R.string.title_no_saf, Snackbar.LENGTH_LONG); + snackbar.setAction(R.string.title_fix, new View.OnClickListener() { + @Override + public void onClick(View v) { + Helper.viewFAQ(getContext(), 25); + } + }); + snackbar.show(); + } + private void onActionLink() { Uri uri = null;