title: Android - Switch ActionBar Back Button to Navigation Button
body: <p>I am having the following problem:</p>
  
  <p>I know how to set up a toolbar to show a back button icon instead of a burger button icon.
  <br><br>
  From this:
  <br>
  <a href="https://i.stack.imgur.com/Sx26a.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Sx26a.png" alt="enter image description here"></a></p>
  
  <p>to this:</p>
  
  <p><a href="https://i.stack.imgur.com/dF12T.png" rel="noreferrer"><img src="https://i.stack.imgur.com/dF12T.png" alt="enter image description here"></a></p>
  
  <p>using: <code>getSupportActionBar().setDisplayHomeAsUpEnabled(true);</code></p>
  
  <p><br>Now, I want to do the reverse action, I want to go from back button icon to burger icon:</p>
  
  <p><a href="https://i.stack.imgur.com/dF12T.png" rel="noreferrer"><img src="https://i.stack.imgur.com/dF12T.png" alt="enter image description here"></a></p>
  
  <p>to here:</p>
  
  <p><a href="https://i.stack.imgur.com/Sx26a.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Sx26a.png" alt="enter image description here"></a></p>
  
  <p>How can I do this?</p>
  
  <p><strong>Update:</strong></p>
  
  <pre><code>@Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  
      setSupportActionBar(mToolbar);
      getSupportActionBar().setDisplayShowTitleEnabled(false);
  }
  
  private void enableViews(boolean enable) {
      if(enable) {
          // Enables back button icon
          getSupportActionBar().setDisplayHomeAsUpEnabled(true);
      } else {
          // TODO: Enables burger icon
      }
  }
  </code></pre>