0

How to set the void onNavigationEvent(int navigationEvent, Bundle extras) for customtabs. My code looks something like

CustomTabsIntent.Builder intentBuilder = new CustomTabsIntent.Builder();
    intentBuilder.setToolbarColor(getResources().getColor(R.color.colorPrimary));
    intentBuilder.setShowTitle(false);
    intentBuilder.setCloseButtonIcon(
            BitmapFactory.decodeResource(getResources(), R.drawable.ic_arrow_back));
    intentBuilder.setStartAnimations(this, R.anim.slide_in_right, R.anim.slide_out_left);
    intentBuilder.setExitAnimations(this, android.R.anim.slide_in_left,
            android.R.anim.slide_out_right);
    CustomTabActivityHelper.openCustomTab(
            this, intentBuilder.build(), Uri.parse(url), new WebviewFallback());
iZBasit
  • 1,314
  • 1
  • 15
  • 30

1 Answers1

1

CustomTabsCallback is added to the CustomTabsClient before you open the url.

You should not call static method of CustomTabActivityHelper, because the CustomTabsSession is created without CustomTabsCallback.

Instead you should change it to something like this:

CustomTabsSession session = mClient.newSession(new CustomTabsCallback());

Nikola Despotoski
  • 49,966
  • 15
  • 119
  • 148