diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/webview/ReactWebViewManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/webview/ReactWebViewManager.java index 1a80722fe..650701851 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/webview/ReactWebViewManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/webview/ReactWebViewManager.java @@ -16,6 +16,7 @@ import java.util.HashMap; import java.util.Locale; import java.util.Map; +import android.content.ActivityNotFoundException; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.Picture; @@ -136,9 +137,13 @@ public class ReactWebViewManager extends SimpleViewManager { url.startsWith("file://")) { return false; } else { - Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); - intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - view.getContext().startActivity(intent); + try { + Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + view.getContext().startActivity(intent); + } catch (ActivityNotFoundException e) { + FLog.w(ReactConstants.TAG, "activity not found to handle uri scheme for: " + url, e); + } return true; } }