Repository: thunderbird/thunderbird-android
File: legacy/ui/legacy/src/main/java/com/fsck/k9/activity/MessageCompose.java (Java)

Code before:
    private boolean identityChanged = false;
    private boolean signatureChanged = false;

    // relates to the message being replied to, forwarded, or edited TODO split up?
    private MessageReference relatedMessageReference;
    private Flag relatedFlag = null;
    /**
     * Indicates that the source message has been processed at least once and should not
     * be processed on any subsequent loads. This protects us from adding attachments that
     * have already been added from the restore of the view state.
     */
    private boolean relatedMessageProcessed = false;
    private MessageViewInfo currentMessageViewInfo;

    private RecipientPresenter recipientPresenter;
    private MessageBuilder currentMessageBuilder;
    private ReplyToPresenter replyToPresenter;
    private boolean finishAfterDraftSaved;
    private boolean alreadyNotifiedUserOfEmptySubject = false;
    private boolean changesMadeSinceLastSave = false;

    private Long draftMessageId = null;

    private Action action;

    private RecipientMvpView recipientMvpView;
    private boolean requestReadReceipt = false;

    private MaterialTextView chooseIdentityView;
    private EditText subjectView;
    private EditText signatureView;
    private EditText messageContentView;
    private LinearLayout attachmentsView;

    private String referencedMessageIds;
    private String repliedToMessageId;

    // The currently used message format.
    private SimpleMessageFormat currentMessageFormat;

    private boolean isInSubActivity = false;

    private boolean navigateUp;

    private boolean sendMessageHasBeenTriggered = false;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        if (UpgradeDatabases.actionUpgradeDatabases(this, getIntent())) {

Review comment (suggestion):
Instead of creating a class member that could leak, it's better to keep it as is and change the `messageLoaderCallbacks` to a private class and inject the `recipientMvpView` when creating it. 

```Java
    private MessageLoaderCallbacks messageLoaderCallbacks = new MessageLoaderCallbacks() {
```

```Java   
    private class MessageComposeMessageLoaderCallback implements MessageLoaderCallbacks {

        private final RecipientMvpView recipientMvpView;

        public MessageComposeMessageLoaderCallback(RecipientMvpView recipientMvpView) {
            this.recipientMvpView = recipientMvpView;
        }
    ...
```

This is possible as `recipientMvpView` is only needed in `onCreate`.

Code after:
    private boolean identityChanged = false;
    private boolean signatureChanged = false;

    // relates to the message being replied to, forwarded, or edited TODO split up?
    private MessageReference relatedMessageReference;
    private Flag relatedFlag = null;
    /**
     * Indicates that the source message has been processed at least once and should not
     * be processed on any subsequent loads. This protects us from adding attachments that
     * have already been added from the restore of the view state.
     */
    private boolean relatedMessageProcessed = false;
    private MessageViewInfo currentMessageViewInfo;

    private RecipientPresenter recipientPresenter;
    private MessageBuilder currentMessageBuilder;
    private ReplyToPresenter replyToPresenter;
    private boolean finishAfterDraftSaved;
    private boolean alreadyNotifiedUserOfEmptySubject = false;
    private boolean changesMadeSinceLastSave = false;

    private Long draftMessageId = null;

    private Action action;

    private boolean requestReadReceipt = false;

    private MaterialTextView chooseIdentityView;
    private EditText subjectView;
    private EditText signatureView;
    private EditText messageContentView;
    private LinearLayout attachmentsView;

    private String referencedMessageIds;
    private String repliedToMessageId;

    // The currently used message format.
    private SimpleMessageFormat currentMessageFormat;

    private boolean isInSubActivity = false;

    private boolean navigateUp;

    private boolean sendMessageHasBeenTriggered = false;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        if (UpgradeDatabases.actionUpgradeDatabases(this, getIntent())) {
            finish();