diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationParentFragment.java b/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationParentFragment.java index 1ec3b1dc6ea..f0770ff7e99 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationParentFragment.java +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationParentFragment.java @@ -2052,7 +2052,7 @@ private void initializeViews(View view) { inputPanel.setListener(this); inputPanel.setMediaListener(this); - attachmentManager = new AttachmentManager(requireActivity(), this); + attachmentManager = new AttachmentManager(requireContext(), view, this); audioRecorder = new AudioRecorder(requireContext()); typingTextWatcher = new ComposeTextWatcher(); diff --git a/app/src/main/java/org/thoughtcrime/securesms/mms/AttachmentManager.java b/app/src/main/java/org/thoughtcrime/securesms/mms/AttachmentManager.java index 092f6b92f7d..e54cb2179a6 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/mms/AttachmentManager.java +++ b/app/src/main/java/org/thoughtcrime/securesms/mms/AttachmentManager.java @@ -101,10 +101,10 @@ public class AttachmentManager { private @NonNull Optional slide = Optional.empty(); private @Nullable Uri captureUri; - public AttachmentManager(@NonNull Activity activity, @NonNull AttachmentListener listener) { - this.context = activity; + public AttachmentManager(@NonNull Context context, @NonNull View rootView, @NonNull AttachmentListener listener) { + this.context = context; this.attachmentListener = listener; - this.attachmentViewStub = ViewUtil.findStubById(activity, R.id.attachment_editor_stub); + this.attachmentViewStub = ViewUtil.findStubById(rootView, R.id.attachment_editor_stub); } private void inflateStub() {