diff --git a/core/ui/src/main/kotlin/com/google/samples/apps/nowinandroid/core/ui/NewsFeed.kt b/core/ui/src/main/kotlin/com/google/samples/apps/nowinandroid/core/ui/NewsFeed.kt
index afdb584a2..a93276e87 100644
--- a/core/ui/src/main/kotlin/com/google/samples/apps/nowinandroid/core/ui/NewsFeed.kt
+++ b/core/ui/src/main/kotlin/com/google/samples/apps/nowinandroid/core/ui/NewsFeed.kt
@@ -16,8 +16,10 @@
package com.google.samples.apps.nowinandroid.core.ui
+import android.content.ActivityNotFoundException
import android.content.Context
import android.net.Uri
+import android.widget.Toast
import androidx.annotation.ColorInt
import androidx.browser.customtabs.CustomTabColorSchemeParams
import androidx.browser.customtabs.CustomTabsIntent
@@ -101,7 +103,11 @@ fun launchCustomChromeTab(context: Context, uri: Uri, @ColorInt toolbarColor: In
.setDefaultColorSchemeParams(customTabBarColor)
.build()
- customTabsIntent.launchUrl(context, uri)
+ try {
+ customTabsIntent.launchUrl(context, uri)
+ } catch (e: ActivityNotFoundException) {
+ Toast.makeText(context, R.string.core_ui_custom_tab_activity_not_found, Toast.LENGTH_LONG).show()
+ }
}
/**
diff --git a/core/ui/src/main/res/values/strings.xml b/core/ui/src/main/res/values/strings.xml
index 65a855fc9..c593a608a 100644
--- a/core/ui/src/main/res/values/strings.xml
+++ b/core/ui/src/main/res/values/strings.xml
@@ -26,4 +26,6 @@
%1$s is followed
%1$s is not followed
+
+ Please install a browser to open this news resource