Guest User

Untitled

a guest
Aug 18th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. @Override
  2. protected void onDestroy() {
  3. super.onDestroy();
  4. customTabActivityHelper.setConnectionCallback(null);
  5. }
  6.  
  7. @Override
  8. protected void onStart() {
  9. super.onStart();
  10. customTabActivityHelper.bindCustomTabsService(this);
  11. }
  12.  
  13. @Override
  14. protected void onStop() {
  15. super.onStop();
  16. customTabActivityHelper.unbindCustomTabsService(this);
  17. }
  18.  
  19. @Override
  20. public void onClick(View view) {
  21. int viewId = view.getId();
  22. Uri uri = Uri.parse(mUrlEditText.getText().toString());
  23. switch (viewId) {
  24. case R.id.button_may_launch_url:
  25. customTabActivityHelper.mayLaunchUrl(uri, null, null);
  26. break;
  27. case R.id.start_custom_tab:
  28. CustomTabsIntent customTabsIntent =
  29. new CustomTabsIntent.Builder(customTabActivityHelper.getSession())
  30. .build();
  31. CustomTabActivityHelper.openCustomTab(
  32. this, customTabsIntent, uri, new WebviewFallback());
  33. break;
  34. default:
  35. //Unkown View Clicked
  36. }
  37. }
Add Comment
Please, Sign In to add comment