I'm changing toolbar color like this:
MainActivity.xml
<Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"></Toolbar>
styles.xml
<style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
<!-- Customize your theme here. -->
<item name="android:colorPrimary">#0000ff</item>
<item name="android:colorPrimaryDark">#ff0000</item>
<item name="android:textColorPrimary">#fff</item>
</style>
and MainActivity.java
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setActionBar(toolbar);
I can change color colorPrimaryDark and textColorPrimary but can not change colorPrimary, why?
I can change toolbar color like this:
toolbar.setBackgroundColor(Color.parseColor("#0000ff"));
but cant change using style also why after removing setActionBar(toolbar); the text and title overflow menu gone why?