Avoid race conditions when updating the UI from events.

This commit is contained in:
akwizgran
2016-10-17 10:54:00 +01:00
parent 50a70f7649
commit 2140a290e4
14 changed files with 239 additions and 93 deletions

View File

@@ -70,6 +70,7 @@ public class InvitationsForumActivity extends InvitationsActivity {
@Override
protected void loadInvitations(final boolean clear) {
final int revision = adapter.getRevision();
runOnDbThread(new Runnable() {
@Override
public void run() {
@@ -80,7 +81,7 @@ public class InvitationsForumActivity extends InvitationsActivity {
long duration = System.currentTimeMillis() - now;
if (LOG.isLoggable(INFO))
LOG.info("Load took " + duration + " ms");
displayInvitations(invitations, clear);
displayInvitations(revision, invitations, clear);
} catch (DbException e) {
if (LOG.isLoggable(WARNING))
LOG.log(WARNING, e.toString(), e);