diff --git a/app/src/main/java/eu/faircode/email/FragmentFolders.java b/app/src/main/java/eu/faircode/email/FragmentFolders.java index 06c6ec364e..59383bd17e 100644 --- a/app/src/main/java/eu/faircode/email/FragmentFolders.java +++ b/app/src/main/java/eu/faircode/email/FragmentFolders.java @@ -228,11 +228,6 @@ public class FragmentFolders extends FragmentBase { args.putLong("account", account); new SimpleTask() { - @Override - protected void onPostExecute(Bundle args) { - swipeRefresh.setRefreshing(false); - } - @Override protected Boolean onExecute(Context context, Bundle args) { long aid = args.getLong("account"); @@ -296,12 +291,15 @@ public class FragmentFolders extends FragmentBase { @Override protected void onExecuted(Bundle args, Boolean now) { - if (!now) + if (!now) { + swipeRefresh.setRefreshing(false); Snackbar.make(view, R.string.title_sync_delayed, Snackbar.LENGTH_LONG).show(); + } } @Override protected void onException(Bundle args, Throwable ex) { + swipeRefresh.setRefreshing(false); if (ex instanceof IllegalArgumentException) Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG).show(); else diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index 13ddf60ff0..a37855f979 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -488,11 +488,6 @@ public class FragmentMessages extends FragmentBase { args.putLong("folder", folder); new SimpleTask() { - @Override - protected void onPostExecute(Bundle args) { - swipeRefresh.setRefreshing(false); - } - @Override protected Boolean onExecute(Context context, Bundle args) { long fid = args.getLong("folder"); @@ -553,12 +548,15 @@ public class FragmentMessages extends FragmentBase { @Override protected void onExecuted(Bundle args, Boolean now) { - if (!now) + if (!now) { + swipeRefresh.setRefreshing(false); Snackbar.make(view, R.string.title_sync_delayed, Snackbar.LENGTH_LONG).show(); + } } @Override protected void onException(Bundle args, Throwable ex) { + swipeRefresh.setRefreshing(false); if (ex instanceof IllegalArgumentException) Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG).show(); else