From 31198a193aa6f4c54303fef9749bf3333810d9df Mon Sep 17 00:00:00 2001 From: Sam Bosley Date: Mon, 22 Oct 2012 14:59:14 -0700 Subject: [PATCH] Should push user status not on the ui thread --- .../astrid/people/PersonViewFragment.java | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/astrid/plugin-src/com/todoroo/astrid/people/PersonViewFragment.java b/astrid/plugin-src/com/todoroo/astrid/people/PersonViewFragment.java index c326d4fb3..0f42808bf 100644 --- a/astrid/plugin-src/com/todoroo/astrid/people/PersonViewFragment.java +++ b/astrid/plugin-src/com/todoroo/astrid/people/PersonViewFragment.java @@ -188,21 +188,26 @@ public class PersonViewFragment extends TaskListFragment { private void refreshData(final boolean manual) { if (user != null) { ((TextView) getView().findViewById(android.R.id.empty)).setText(R.string.DLG_loading); - if (!TextUtils.isEmpty(user.getValue(User.PENDING_STATUS))) { - actFmSyncService.pushUser(user); - user = userDao.fetch(user.getId(), User.PROPERTIES); - } - syncService.synchronizeList(user, manual, new ProgressBarSyncResultCallback(getActivity(), this, - R.id.progressBar, new Runnable() { + new Thread() { @Override public void run() { - if (manual) - ContextManager.getContext().sendBroadcast(new Intent(AstridApiConstants.BROADCAST_EVENT_REFRESH)); - else - refresh(); - ((TextView) getView().findViewById(android.R.id.empty)).setText(getEmptyDisplayString()); + if (!TextUtils.isEmpty(user.getValue(User.PENDING_STATUS))) { + actFmSyncService.pushUser(user); + user = userDao.fetch(user.getId(), User.PROPERTIES); + } + syncService.synchronizeList(user, manual, new ProgressBarSyncResultCallback(getActivity(), PersonViewFragment.this, + R.id.progressBar, new Runnable() { + @Override + public void run() { + if (manual) + ContextManager.getContext().sendBroadcast(new Intent(AstridApiConstants.BROADCAST_EVENT_REFRESH)); + else + refresh(); + ((TextView) getView().findViewById(android.R.id.empty)).setText(getEmptyDisplayString()); + } + })); } - })); + }.start(); } }