From ac65b77de901d44caaf5308f6503a3d1a0d7f877 Mon Sep 17 00:00:00 2001 From: "B. Petersen" Date: Thu, 23 Jan 2020 11:13:24 +0100 Subject: [PATCH] fix saving drafts this is an addition to #1192: by calling processComposeControls() twice, in onPause() and on Destroy(), the seccond call gets an empty draft. as onDestroy() is not guarateed to be executed anyway - this was the intent of the move in pr #1192 - we just remove this call and rely on onPause(). see https://developer.android.com/reference/android/app/Activity.html for lifecycles and killable events. --- src/org/thoughtcrime/securesms/ConversationActivity.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/org/thoughtcrime/securesms/ConversationActivity.java b/src/org/thoughtcrime/securesms/ConversationActivity.java index 457a4d7d5..d0a041a38 100644 --- a/src/org/thoughtcrime/securesms/ConversationActivity.java +++ b/src/org/thoughtcrime/securesms/ConversationActivity.java @@ -305,7 +305,6 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity @Override protected void onPause() { super.onPause(); - // save draft on pause processComposeControls(ACTION_SAVE_DRAFT); MessageNotifierCompat.updateVisibleChat(MessageNotifierCompat.NO_VISIBLE_CHAT_ID); if (isFinishing()) overridePendingTransition(R.anim.fade_scale_in, R.anim.slide_to_right); @@ -333,7 +332,6 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity @Override protected void onDestroy() { - processComposeControls(ACTION_SAVE_DRAFT); dcContext.eventCenter.removeObservers(this); super.onDestroy(); }