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.
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.
You can do this:
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(Color.BLUE));
Or so:
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.colorBlack)));