From 78e3afc1af6b96d37d3f488af0481ec016823925 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Fri, 24 Jun 2016 13:36:06 +0200 Subject: show error toasts on ui thread --- .../conversations/ui/ConversationActivity.java | 23 +++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java index e328084f..0ed35049 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java @@ -1464,13 +1464,20 @@ public class ConversationActivity extends XmppActivity } @Override - public void error(int errorCode, Message message) { - replaceToast(getString(errorCode)); + public void error(final int errorCode, Message message) { + hidePrepareFileToast(prepareFileToast); + runOnUiThread(new Runnable() { + @Override + public void run() { + replaceToast(getString(errorCode)); + } + }); + } @Override public void userInputRequried(PendingIntent pi, Message message) { - + hidePrepareFileToast(prepareFileToast); } }); } @@ -1496,8 +1503,14 @@ public class ConversationActivity extends XmppActivity } @Override - public void error(int error, Message message) { - replaceToast(getString(error)); + public void error(final int error, Message message) { + hidePrepareFileToast(prepareFileToast); + runOnUiThread(new Runnable() { + @Override + public void run() { + replaceToast(getString(error)); + } + }); } }); } -- cgit v1.2.3