diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/toast/ToastModule.java b/ReactAndroid/src/main/java/com/facebook/react/modules/toast/ToastModule.java index d401bfa1d0b3e2..ea6cb471fbe382 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/toast/ToastModule.java +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/toast/ToastModule.java @@ -17,6 +17,7 @@ import com.facebook.react.bridge.ReactContextBaseJavaModule; import com.facebook.react.bridge.ReactMethod; import com.facebook.react.common.MapBuilder; +import com.facebook.react.bridge.UiThreadUtil; import java.util.Map; @@ -46,7 +47,12 @@ public Map getConstants() { } @ReactMethod - public void show(String message, int duration) { - Toast.makeText(getReactApplicationContext(), message, duration).show(); + public void show(final String message, final int duration) { + UiThreadUtil.runOnUiThread(new Runnable() { + @Override + public void run(){ + Toast.makeText(getReactApplicationContext(), message, duration).show(); + } + }); } }