Android - "setToolbarColor(int)" and "setSecondaryToolbarColor(int)" is deprecated
Use CustomTabColorSchemeParams
instead: Reference
Uri uri = Uri.parse(url);CustomTabsIntent.Builder intentBuilder = new CustomTabsIntent.Builder();CustomTabColorSchemeParams params = new CustomTabColorSchemeParams.Builder() .setNavigationBarColor(ContextCompat.getColor(activity,R.color.background)) .setToolbarColor(ContextCompat.getColor(activity,R.color.background)) .setSecondaryToolbarColor(ContextCompat.getColor(activity,R.color.background)) .build();intentBuilder.setColorSchemeParams(CustomTabsIntent.COLOR_SCHEME_DARK, params);intentBuilder.setStartAnimations(activity, R.anim.slide_in_right,R.anim.slide_out_left);intentBuilder.setExitAnimations(activity,android.R.anim.slide_in_left,android.R.anim.slide_out_right);CustomTabsIntent customTabsIntent = intentBuilder.build();customTabsIntent.launchUrl(activity,uri);