// get the current toolbar background color (this might work differently in your app)@ColorIntintcolorPrimaryLight=ContextCompat.getColor(MainActivity.this,R.color.md_theme_light_primary);@ColorIntintcolorPrimaryDark=ContextCompat.getColor(MainActivity.this,R.color.md_theme_dark_primary);CustomTabsIntentintent=newCustomTabsIntent.Builder()// set the default color scheme.setDefaultColorSchemeParams(newCustomTabColorSchemeParams.Builder().setToolbarColor(colorPrimaryLight).build())// set the alternative dark color scheme.setColorSchemeParams(CustomTabsIntent.COLOR_SCHEME_DARK,newCustomTabColorSchemeParams.Builder().setToolbarColor(colorPrimaryDark).build()).build();