diff --git a/src/main/java/eu/siacs/conversations/ui/ChooseAccountForProfilePictureActivity.java b/src/main/java/eu/siacs/conversations/ui/ChooseAccountForProfilePictureActivity.java
index cfb4f05fb..fca082c42 100644
--- a/src/main/java/eu/siacs/conversations/ui/ChooseAccountForProfilePictureActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/ChooseAccountForProfilePictureActivity.java
@@ -5,6 +5,7 @@ import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.widget.ListView;
+import android.widget.Toast;
import java.util.ArrayList;
import java.util.List;
@@ -78,7 +79,12 @@ public class ChooseAccountForProfilePictureActivity extends XmppActivity {
intent.putExtra(EXTRA_ACCOUNT, account.getJid().asBareJid().toString());
intent.setData(uri);
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
- startActivity(intent);
+ try {
+ startActivity(intent);
+ } catch (SecurityException e) {
+ Toast.makeText(this, R.string.sharing_application_not_grant_permission, Toast.LENGTH_SHORT).show();
+ return;
+ }
}
finish();
}
diff --git a/src/main/java/eu/siacs/conversations/ui/ShareWithActivity.java b/src/main/java/eu/siacs/conversations/ui/ShareWithActivity.java
index 0ec7abd9a..dd4ea40a2 100644
--- a/src/main/java/eu/siacs/conversations/ui/ShareWithActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/ShareWithActivity.java
@@ -200,7 +200,12 @@ public class ShareWithActivity extends XmppActivity implements XmppConnectionSer
intent.putExtra(Intent.EXTRA_TEXT, share.text);
intent.putExtra(ConversationsActivity.EXTRA_AS_QUOTE, share.asQuote);
}
- startActivity(intent);
+ try {
+ startActivity(intent);
+ } catch (SecurityException e) {
+ Toast.makeText(this, R.string.sharing_application_not_grant_permission, Toast.LENGTH_SHORT).show();
+ return;
+ }
finish();
}
diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml
index 799ee5071..3674aab53 100644
--- a/src/main/res/values/strings.xml
+++ b/src/main/res/values/strings.xml
@@ -878,4 +878,5 @@
Please enter the password for this account
Unable to perform this action
Join public channel…
+ The sharing application did not grant permission to access this file.