Change creation of drafts to onStop method.

Drafts were created only on destroy of the conversation activity.
Moved it to be on stop for the activity.

Closes #1985
This commit is contained in:
Tal Hacohen 2014-10-08 21:11:02 +03:00 committed by Moxie Marlinspike
parent 07bb07c342
commit 990902845a

View File

@ -179,12 +179,18 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
initializeReceivers(); initializeReceivers();
initializeResources(); initializeResources();
initializeDraft();
} }
@Override @Override
protected void onStart() { protected void onStart() {
super.onStart(); super.onStart();
initializeDraft();
}
@Override
protected void onStop() {
super.onStop();
saveDraft();
} }
@Override @Override
@ -216,7 +222,6 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
protected void onDestroy() { protected void onDestroy() {
unregisterReceiver(securityUpdateReceiver); unregisterReceiver(securityUpdateReceiver);
unregisterReceiver(groupUpdateReceiver); unregisterReceiver(groupUpdateReceiver);
saveDraft();
MemoryCleaner.clean(masterSecret); MemoryCleaner.clean(masterSecret);
super.onDestroy(); super.onDestroy();
} }