title: How to get Home Button as MenuItem android
body: <p>I am setting my toolbar:</p>
  
  <pre><code>Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
  setSupportActionBar(toolbar);
  assert getSupportActionBar() != null;
  getSupportActionBar().setDisplayHomeAsUpEnabled(true);
  getSupportActionBar().setHomeAsUpIndicator(R.drawable.ic_back);
  toolbar.setTitle(R.string.app_name);
  </code></pre>
  
  <p>How can I retrieve the home button (<code>android.R.id.home</code>) as a <code>MenuItem</code>?</p>
  
  <p>Here's what I tried:</p>
  
  <pre><code>MenuItem back = menu.findItem(android.R.id.home);
  </code></pre>
  
  <p>But that makes a <code>NullPointerException</code> for some reason. So how can I retrieve it as <code>MenuItem</code> without getting a <code>NullPointerException</code>?</p>