Skip to content

Instantly share code, notes, and snippets.

@saurabharora90
Last active August 18, 2018 19:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saurabharora90/cede480e8a778488aae33da8d23cc941 to your computer and use it in GitHub Desktop.
Save saurabharora90/cede480e8a778488aae33da8d23cc941 to your computer and use it in GitHub Desktop.
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