title: Switch from Up Arrow to Hamburger Icon on Button Click in ActionBar
body: <p>I want to change the <strong>Hamburger icon</strong> on Android ActionBar to <strong>Up arrow</strong> on button click, and also to change the Up arrow back to Hamburger icon on another button click event.</p>
  
  <p>I have tried using ,</p>
  
  <pre><code>getSupportActionBar().setHomeButtonEnabled(true);
  getSupportActionBar().setDisplayShowHomeEnabled(true);
  </code></pre>
  
  <p>However, none of them works. I can change the Hamburger icon to up arrow easily using, </p>
  
  <pre><code>getSupportActionBar().setDisplayHomeAsUpEnabled(true);
  </code></pre>
  
  <p>But <strong>not the vice-versa</strong>. </p>
  
  <p>Also, how do I <strong>override the home button control</strong>? </p>
  
  <p>I mean when a certain layout is open, I want the up arrow to close that layout on click and not to call the navigation drawer.</p>
  
  <p>Please help.</p>