diff --git a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java index 49dc79428..10a60d7c2 100644 --- a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java +++ b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java @@ -807,12 +807,17 @@ public void getUnreadMessagesCount(Callback messageCountCallback) { * @see InstabugInvocationEvent */ @ReactMethod - public void setInvocationEvent(String invocationEventValue) { - try { - BugReporting.setInvocationEvents(getInvocationEventById(invocationEventValue)); - } catch (Exception e) { - e.printStackTrace(); - } + public void setInvocationEvent(final String invocationEventValue) { + new Handler(Looper.getMainLooper()).post(new Runnable() { + @Override + public void run() { + try { + BugReporting.setInvocationEvents(getInvocationEventById(invocationEventValue)); + } catch (Exception e) { + e.printStackTrace(); + } + } + }); } /**