Fix for no SAF

This commit is contained in:
M66B 2020-02-23 14:02:14 +01:00
parent 40554d75d5
commit b1e4d557d5
1 changed files with 13 additions and 2 deletions

View File

@ -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;