catch security exception when viewing file from media preview
This commit is contained in:
parent
d436c5f856
commit
25f137441b
|
@ -75,8 +75,10 @@ public class MediaPreviewAdapter extends RecyclerView.Adapter<MediaPreviewAdapte
|
||||||
view.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
view.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||||
try {
|
try {
|
||||||
context.startActivity(view);
|
context.startActivity(view);
|
||||||
} catch (ActivityNotFoundException e) {
|
} catch (final ActivityNotFoundException e) {
|
||||||
Toast.makeText(context, R.string.no_application_found_to_open_file, Toast.LENGTH_SHORT).show();
|
Toast.makeText(context, R.string.no_application_found_to_open_file, Toast.LENGTH_SHORT).show();
|
||||||
|
} catch (final SecurityException e) {
|
||||||
|
Toast.makeText(context, R.string.sharing_application_not_grant_permission, Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue