ActionBar Color

1

I would like to know how I can change the color of ActionBar dynamically?

I've tried to get it for getSupportActionBar but I could not.

    
asked by anonymous 09.01.2016 / 21:07

1 answer

3

You can do this:

getSupportActionBar().setBackgroundDrawable(new ColorDrawable(Color.BLUE));

Or so:

getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.colorBlack)));
    
09.01.2016 / 22:58