Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
private val customTabActivityHelper: CustomTabActivityHelper =
CustomTabActivityHelper(this, lifecycle, this)
override fun onClick(view: View) {
val viewId = view.id
val uri = Uri.parse(urlEditText.text.toString())
when (viewId) {
R.id.button_may_launch_url -> customTabActivityHelper.mayLaunchUrl(uri)
R.id.start_custom_tab -> {
val customTabsIntent = CustomTabsIntent.Builder(customTabActivityHelper.session)
.build()
customTabsIntent.launchWithFallback(
this, uri, WebviewFallback())
}
}//Unkown View Clicked
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment