Quick fix for attaching

This commit is contained in:
M66B 2018-08-11 20:10:49 +00:00
parent 7b32bf1942
commit b34abdc338
1 changed files with 9 additions and 1 deletions

View File

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