diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
index 6ca868ba8..f0c3bc181 100644
--- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
+++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
@@ -1048,10 +1048,11 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
return binding.getRoot();
}
+
@Override
public void onDestroyView() {
super.onDestroyView();
- Log.d(Config.LOGTAG,"ConversationFragment.onDestroyView()");
+ Log.d(Config.LOGTAG, "ConversationFragment.onDestroyView()");
messageListAdapter.setOnContactPictureClicked(null);
messageListAdapter.setOnContactPictureLongClicked(null);
messageListAdapter.setOnQuoteListener(null);
@@ -1729,7 +1730,10 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
break;
}
final Context context = getActivity();
- if (context != null && intent.resolveActivity(context.getPackageManager()) != null) {
+ if (context == null) {
+ return;
+ }
+ if (intent.resolveActivity(context.getPackageManager()) != null) {
if (chooser) {
startActivityForResult(
Intent.createChooser(intent, getString(R.string.perform_action_with)),
@@ -1737,6 +1741,8 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
} else {
startActivityForResult(intent, attachmentChoice);
}
+ } else {
+ Toast.makeText(context, R.string.no_application_found, Toast.LENGTH_LONG).show();
}
}
diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml
index 8362cc28c..f40317ea8 100644
--- a/src/main/res/values/strings.xml
+++ b/src/main/res/values/strings.xml
@@ -949,4 +949,5 @@
Failed deliveries
More options
+ No application found