No, you cannot, because the color of the accent is defined in the theme, and the themes are read-only in Android.
The only thing you can do is switch themes or set the color of each component manually.
Note You can apply the theme to part of the user interface, rather than the entire operation, to change the accent color (or other things) locally. To do this, you can use the android:theme attribute in your XML layout using the AppCompat library, or you can inflate the layout by providing ContextThemeWrapper as the context for your LayoutInflater .
source share