I have created the action bar by
ActionBar actionbar = getActionBar()
The background of the action bar is changed by
acti
Here is a much easier way. I know you were looking for a programmatic change, but this one is REALLY easy.
I've been struggling with this for days, but finally found the solution. I'm using AppCompat. You can set colorAccent in your theme and that will change the highlight color on your ActionBar. Like so:
- @color/highlightcolor
Here it is in context:
Where I originally posted this answer: Android Tab underline color not changing