androidgoogle-chromechrome-custom-tabs

Chrome custom tabs not working correctly with CustomTabsIntent


I've been trying to explore the Google Chrome custom tabs tool but something is intriguing me.

Using the following version of the library on Android Studio

compile 'com.android.support:customtabs:23.2.0'

and then running a sample using the CustomTabsIntent isn't working as I expected.

CustomTabsIntent customTabsIntent = new CustomTabsIntent.Builder(customTabActivityHelper.getSession())
                        .setCloseButtonIcon(BitmapFactory.decodeResource(getContext().getResources(), R.drawable.ic_action_back))
                        .setToolbarColor(Color.RED)
                        .addDefaultShareMenuItem()
                        .build();
CustomTabActivityHelper.openCustomTab(getActivity(), customTabsIntent, Uri.parse(url), null);

Using this, only the setToolbarColor() is working. The setCloseButtonIcon(), addDefaultShareMenuItem() or even other instructions are not taking any effect.

Has anybody experienced something like this?


Solution

  • There are two different reason: