BrowserUtils

object BrowserUtils

Functions

Link copied to clipboard
fun deduceActivityType(context: Context, preferredType: ActivityType?): ActivityType
Link copied to clipboard
fun getAvailableCustomTabsBrowsers(context: Context): List<String>
Link copied to clipboard
fun getCustomTabsBrowserPackageName(context: Context): String?

Returns the package name of a browser that supports custom tabs or null if there's none available.

Link copied to clipboard
fun isCustomTabsBrowserAvailable(context: Context): Boolean

Checks whether the system has a custom tabs compatible browser installed and a CustomTabsSession has been initialized.

Link copied to clipboard
fun isPlainBrowserAvailable(context: Context): Boolean
Link copied to clipboard
fun isTrustedWebActivityAvailable(context: Context): Boolean

Returns True if TrustedWebActivity is supported on the device.

Link copied to clipboard
fun launchCustomTabsBrowser(context: Context, url: String)
Link copied to clipboard
fun launchPlainBrowser(activity: Activity, url: String)

Sources

Link copied to clipboard