From these answers, I suppose I know how to grab the primary color. However, when I try to set the background color of the toolbar, I keep getting exception that the resourceId for the color I am specifying is not found
android.content.res.Resources$NotFoundException: Resource ID ...
I have tried
toolbar.setBackgroundResource(primaryColor);
and I have tried
toolbar.setBackgroundColor(primaryColor);