List of usage examples for com.facebook.react.bridge UiThreadUtil assertOnUiThread
public static void assertOnUiThread()
From source file:org.jitsi.meet.sdk.ListenerUtils.java
License:Apache License
/** * Helper companion for {@link ListenerUtils#runListenerMethod} which runs * in the UI thread.// www . j a v a2s. c o m */ private static void runListenerMethodOnUiThread(Object listener, Map<String, Method> listenerMethods, String eventName, ReadableMap eventData) { UiThreadUtil.assertOnUiThread(); Method method = listenerMethods.get(eventName); if (method != null) { try { method.invoke(listener, toHashMap(eventData)); } catch (IllegalAccessException e) { throw new RuntimeException(e); } catch (InvocationTargetException e) { throw new RuntimeException(e); } } }