Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- protected void onDestroy() {
- super.onDestroy();
- customTabActivityHelper.setConnectionCallback(null);
- }
- @Override
- protected void onStart() {
- super.onStart();
- customTabActivityHelper.bindCustomTabsService(this);
- }
- @Override
- protected void onStop() {
- super.onStop();
- customTabActivityHelper.unbindCustomTabsService(this);
- }
- @Override
- public void onClick(View view) {
- int viewId = view.getId();
- Uri uri = Uri.parse(mUrlEditText.getText().toString());
- switch (viewId) {
- case R.id.button_may_launch_url:
- customTabActivityHelper.mayLaunchUrl(uri, null, null);
- break;
- case R.id.start_custom_tab:
- CustomTabsIntent customTabsIntent =
- new CustomTabsIntent.Builder(customTabActivityHelper.getSession())
- .build();
- CustomTabActivityHelper.openCustomTab(
- this, customTabsIntent, uri, new WebviewFallback());
- break;
- default:
- //Unkown View Clicked
- }
- }
Add Comment
Please, Sign In to add comment