title: Set Toolbar Icon Colour Programmatically
body: <p>How can I set the colour of icons (home and overflow menu icon) in a <code>Toolbar</code>/<code>AppBarLayout</code> <em>programmatically</em>?</p>
  
  <p>I want to change the toolbar's colour scheme for a single fragment in an activity. Setting the <code>AppBarLayout</code>'s background to a light colour (e.g. light gray with <code>appBarLayout.setBackgroundResource(..);</code>) results in white icons and a white title which are barely visible.</p>
  
  <p>Its layout is as follows:</p>
  
  <pre><code>&lt;android.support.design.widget.AppBarLayout
      android:id="@+id/appbar"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:fitsSystemWindows="true"&gt;
  
      &lt;android.support.v7.widget.Toolbar
          android:id="@+id/toolbar"
          android:layout_width="match_parent"
          android:layout_height="?attr/actionBarSize"
          android:theme="@style/ToolbarStyle"
          app:layout_scrollFlags="scroll|enterAlways"/&gt;
  
  &lt;/android.support.design.widget.AppBarLayout&gt;
  </code></pre>
  
  <hr>
  
  <p><strong><a href="https://stackoverflow.com/a/36037707/447697">Solution found</a></strong></p>