From 8e701da3290e8962b8102961ac50f5bf0d006f08 Mon Sep 17 00:00:00 2001 From: ChronosX88 Date: Sat, 23 Mar 2019 16:44:42 +0400 Subject: [PATCH] Fixed crash when showing snackbar message in StartChatFragment --- .../influence/views/fragments/StartChatFragment.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/github/chronosx88/influence/views/fragments/StartChatFragment.java b/app/src/main/java/io/github/chronosx88/influence/views/fragments/StartChatFragment.java index 91e216d..c35666c 100644 --- a/app/src/main/java/io/github/chronosx88/influence/views/fragments/StartChatFragment.java +++ b/app/src/main/java/io/github/chronosx88/influence/views/fragments/StartChatFragment.java @@ -45,7 +45,9 @@ public class StartChatFragment extends Fragment implements StartChatViewContract @Override public void showMessage(String message) { - Snackbar.make(getView().findViewById(R.id.start_chat_coordinator), message, Snackbar.LENGTH_SHORT).show(); + requireActivity().runOnUiThread(() -> { + Snackbar.make(getView().findViewById(R.id.start_chat_coordinator), message, Snackbar.LENGTH_SHORT).show(); + }); } @Override