Asked
Active
Viewed 531 times
2 Answers
1
I think you mean to the AppBar color. You can do it with
ActionBar bar = getActionBar();
bar.setBackgroundDrawable(new ColorDrawable(getResources().getColor(R.color.mycolor));
Add value in colors:
<color name="mycolor">#FFFFFF</color>
The answer is from here: Change action bar color in android
0
If you want to do in XML Try this tutorial from google
If you want to set it up in code:
public class MainActivity extends AppCompact {
@Override
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ActionBar actionBar = getActionBar();
actionBar.setBackgroundDrawable(new ColorDrawable(Color.BLUE)); // set your desired color
...
}
...
}

sumandas
- 555
- 7
- 20
-
Apologies, in your onCreate() method for the activity, after your setContentView(your xml). Place this, forcing the view drawing to take this into effect. – sumandas Aug 15 '16 at 21:26
-
I'm not sure I have this set up correctly im not seeing that – Three Suit Studios LLC Aug 15 '16 at 21:34
-
Updated the answer, let me know if it helps. – sumandas Aug 15 '16 at 23:19