1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-24 02:12:15 -05:00

added mIgnoreOnStop for when adding an attachment.

This commit is contained in:
ashley willis 2011-11-03 15:38:53 -05:00
parent a021ab71de
commit 7f582f5a38

View File

@ -212,6 +212,8 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
private boolean mDraftNeedsSaving = false;
private boolean mPreventDraftSaving = false;
private boolean mIgnoreOnStop = false;
/**
* The draft uid of this message. This is used when saving drafts so that the same draft is
* overwritten instead of being created anew. This property is null until the first save.
@ -784,6 +786,7 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
@Override
public void onResume() {
super.onResume();
mIgnoreOnStop = false;
MessagingController.getInstance(getApplication()).addListener(mListener);
}
@ -799,8 +802,8 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
super.onStop();
// don't do this if only changing orientations
if ((getChangingConfigurations() & ActivityInfo.CONFIG_ORIENTATION) == 0) {
// don't do this if selecting signature or if "Encrypt" is checked
if (!mPreventDraftSaving && !mEncryptCheckbox.isChecked()){
// don't do this if selecting signature or if "Encrypt" is checked or if adding an attachment
if (!mPreventDraftSaving && !mEncryptCheckbox.isChecked() && !mIgnoreOnStop){
saveIfNeeded();
finish();
}
@ -1467,6 +1470,7 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
* Kick off a picker for whatever kind of MIME types we'll accept and let Android take over.
*/
private void onAddAttachment() {
mIgnoreOnStop = true;
if (K9.isGalleryBuggy()) {
if (K9.useGalleryBugWorkaround()) {
Toast.makeText(MessageCompose.this,
@ -2626,7 +2630,6 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
private class SaveMessageTask extends AsyncTask<Void, Void, Void> {
@Override
protected Void doInBackground(Void... params) {
/*
* Create the message from all the data the user has entered.
*/