Should push user status not on the ui thread

pull/14/head
Sam Bosley 12 years ago
parent e5d049874d
commit 31198a193a

@ -188,21 +188,26 @@ public class PersonViewFragment extends TaskListFragment {
private void refreshData(final boolean manual) { private void refreshData(final boolean manual) {
if (user != null) { if (user != null) {
((TextView) getView().findViewById(android.R.id.empty)).setText(R.string.DLG_loading); ((TextView) getView().findViewById(android.R.id.empty)).setText(R.string.DLG_loading);
if (!TextUtils.isEmpty(user.getValue(User.PENDING_STATUS))) { new Thread() {
actFmSyncService.pushUser(user);
user = userDao.fetch(user.getId(), User.PROPERTIES);
}
syncService.synchronizeList(user, manual, new ProgressBarSyncResultCallback(getActivity(), this,
R.id.progressBar, new Runnable() {
@Override @Override
public void run() { public void run() {
if (manual) if (!TextUtils.isEmpty(user.getValue(User.PENDING_STATUS))) {
ContextManager.getContext().sendBroadcast(new Intent(AstridApiConstants.BROADCAST_EVENT_REFRESH)); actFmSyncService.pushUser(user);
else user = userDao.fetch(user.getId(), User.PROPERTIES);
refresh(); }
((TextView) getView().findViewById(android.R.id.empty)).setText(getEmptyDisplayString()); 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();
} }
} }

Loading…
Cancel
Save