From 869564df5884d96820d990c92e3554a21a9da77f Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 2 Feb 2022 09:16:39 +0100 Subject: [PATCH] Feedback on change to external storage --- .../java/eu/faircode/email/FragmentOptionsMisc.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java index 00c61ee224..4df9ec0610 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java @@ -789,9 +789,9 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc Bundle args = new Bundle(); args.putBoolean("external_storage", isChecked); - new SimpleTask() { + new SimpleTask() { @Override - protected Void onExecute(Context context, Bundle args) throws IOException { + protected Integer onExecute(Context context, Bundle args) throws IOException { boolean external_storage = args.getBoolean("external_storage"); File source = (!external_storage @@ -814,7 +814,13 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc attachment.delete(); } - return null; + return (attachments == null ? -1 : attachments.length); + } + + @Override + protected void onExecuted(Bundle args, Integer count) { + String msg = String.format("Moved %d attachments", count); + ToastEx.makeText(getContext(), msg, Toast.LENGTH_LONG).show(); } @Override