show toast if no application found to attach

(cherry picked from commit b327548c85)
This commit is contained in:
Daniel Gultsch 2020-11-13 12:50:05 +01:00 committed by Christian Schneppe
parent a63c1fc8a0
commit 459ecb6e85
No known key found for this signature in database
GPG key ID: F30B8D686B44D87E
2 changed files with 9 additions and 2 deletions

View file

@ -1216,10 +1216,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);
@ -1958,7 +1959,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) {
Log.d(Config.LOGTAG, "Attachment: " + attachmentChoice);
if (chooser) {
startActivityForResult(
@ -1969,6 +1973,8 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
startActivityForResult(intent, attachmentChoice);
activity.overridePendingTransition(R.animator.fade_in, R.animator.fade_out);
}
} else {
Toast.makeText(context, R.string.no_application_found, Toast.LENGTH_LONG).show();
}
}

View file

@ -1073,4 +1073,5 @@
<string name="updated_to_blabber">We have successfully updated Pix-Art Messenger to blabber.im\n\nThe cooperation of the two projects blabber.im and Pix-Art Messenger was expanded in November 2020. In the future, the Android app Pix-Art Messenger will be continued under the name blabber.im.\n\nWhat you can expect:\n- Range of functions remains the same\n- Support chat rooms are merged\n- Colors and logos are adapted to blabber.im\n- App is still available for free in Google Play Store and F-Droid Store\n\nYour blabber.im Team</string>
<string name="updated_to_blabber_google">We have to apologize that we could not update directly to blabber.im. Under the following link you will receive instructions on how to transfer all your profiles from Pix-Art Messenger to blabber.im.</string>
<string name="link">Link</string>
<string name="no_application_found">No application found</string>
</resources>