diff --git a/src/com/fsck/k9/controller/MessagingController.java b/src/com/fsck/k9/controller/MessagingController.java index 6ff3550b3..61e6a48df 100644 --- a/src/com/fsck/k9/controller/MessagingController.java +++ b/src/com/fsck/k9/controller/MessagingController.java @@ -804,6 +804,9 @@ public class MessagingController implements Runnable { threadPool.execute(new Runnable() { @Override public void run() { + if (listener != null) { + listener.enableProgressIndicator(true); + } try { Store remoteStore = account.getRemoteStore(); LocalStore localStore = account.getLocalStore(); @@ -822,6 +825,10 @@ public class MessagingController implements Runnable { } catch (MessagingException e) { Log.e(K9.LOG_TAG, "Exception in loadSearchResults: " + e); addErrorMessage(account, null, e); + } finally { + if (listener != null) { + listener.enableProgressIndicator(false); + } } } }); diff --git a/src/com/fsck/k9/controller/MessagingListener.java b/src/com/fsck/k9/controller/MessagingListener.java index 5e1080a45..6fce2c6e2 100644 --- a/src/com/fsck/k9/controller/MessagingListener.java +++ b/src/com/fsck/k9/controller/MessagingListener.java @@ -207,4 +207,6 @@ public class MessagingListener { * {@code false} otherwise. */ public void controllerCommandCompleted(boolean moreCommandsToRun) {} + + public void enableProgressIndicator(boolean enable) { } } diff --git a/src/com/fsck/k9/fragment/MessageListFragment.java b/src/com/fsck/k9/fragment/MessageListFragment.java index 0ab92c349..eb8eb4333 100644 --- a/src/com/fsck/k9/fragment/MessageListFragment.java +++ b/src/com/fsck/k9/fragment/MessageListFragment.java @@ -1508,6 +1508,10 @@ public class MessageListFragment extends SherlockFragment implements OnItemClick mHandler.updateFooter(mContext.getString(R.string.remote_search_sending_query)); } + @Override + public void enableProgressIndicator(boolean enable) { + mHandler.progress(enable); + } @Override public void remoteSearchFinished(Account acct, String folder, int numResults, List extraResults) {