From a81cc685b29300f27d314496eea8f15f58083a29 Mon Sep 17 00:00:00 2001 From: Greyson Parrelli Date: Sat, 1 Dec 2018 10:00:35 -0800 Subject: [PATCH] Fix crash where toolbar was updated off of the main thread. --- src/org/thoughtcrime/securesms/MediaOverviewActivity.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/org/thoughtcrime/securesms/MediaOverviewActivity.java b/src/org/thoughtcrime/securesms/MediaOverviewActivity.java index c69f7c2104..519cc30862 100644 --- a/src/org/thoughtcrime/securesms/MediaOverviewActivity.java +++ b/src/org/thoughtcrime/securesms/MediaOverviewActivity.java @@ -66,6 +66,7 @@ import org.thoughtcrime.securesms.util.DynamicNoActionBarTheme; import org.thoughtcrime.securesms.util.DynamicTheme; import org.thoughtcrime.securesms.util.SaveAttachmentTask; import org.thoughtcrime.securesms.util.StickyHeaderDecoration; +import org.thoughtcrime.securesms.util.Util; import org.thoughtcrime.securesms.util.ViewUtil; import org.thoughtcrime.securesms.util.task.ProgressDialogAsyncTask; @@ -140,7 +141,9 @@ public class MediaOverviewActivity extends PassphraseRequiredActionBarActivity { setSupportActionBar(this.toolbar); getSupportActionBar().setTitle(recipient.toShortString()); getSupportActionBar().setDisplayHomeAsUpEnabled(true); - this.recipient.addListener(recipient -> getSupportActionBar().setTitle(recipient.toShortString())); + this.recipient.addListener(recipient -> { + Util.runOnMain(() -> getSupportActionBar().setTitle(recipient.toShortString())); + }); } public void onEnterMultiSelect() {