Browse Source

Quick fix for attaching

main
M66B 6 years ago
parent
commit
b34abdc338
1 changed files with 9 additions and 1 deletions
  1. +9
    -1
      app/src/main/java/eu/faircode/email/FragmentCompose.java

+ 9
- 1
app/src/main/java/eu/faircode/email/FragmentCompose.java View File

@ -96,6 +96,7 @@ public class FragmentCompose extends FragmentEx {
private AdapterAttachment adapter; private AdapterAttachment adapter;
private boolean attaching = false;
private String action = null; private String action = null;
private long id = -1; // draft id private long id = -1; // draft id
private long account = -1; private long account = -1;
@ -318,7 +319,8 @@ public class FragmentCompose extends FragmentEx {
@Override @Override
public void onPause() { public void onPause() {
onAction(R.id.action_save);
if (!attaching)
onAction(R.id.action_save);
super.onPause(); super.onPause();
} }
@ -349,6 +351,7 @@ public class FragmentCompose extends FragmentEx {
} }
private void onMenuAttachment() { private void onMenuAttachment() {
attaching = true;
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT); Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
intent.addCategory(Intent.CATEGORY_OPENABLE); intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType("*/*"); intent.setType("*/*");
@ -486,6 +489,11 @@ public class FragmentCompose extends FragmentEx {
} }
} }
@Override
public void onLoaded(Bundle args, Void data) {
attaching = false;
}
@Override @Override
public void onException(Bundle args, Throwable ex) { public void onException(Bundle args, Throwable ex) {
Toast.makeText(getContext(), ex.toString(), Toast.LENGTH_LONG).show(); Toast.makeText(getContext(), ex.toString(), Toast.LENGTH_LONG).show();


Loading…
Cancel
Save