title: Android Back Arrow on Toolbar (AppCompatActivity)
body: <p>I want to show the back arrow button in my app, but the app crashes when I put this in my code:</p>
  
  <pre><code>getSupportActionBar().setDisplayHomeAsUpEnabled(true);
  getSupportActionBar().setDisplayShowHomeEnabled(true);
  </code></pre>
  
  <p><strong>style.xml</strong></p>
  
  <pre><code> &lt;style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"&gt;
      &lt;item name="colorPrimary"&gt;@color/PrimaryColor&lt;/item&gt;
      &lt;item name="colorPrimaryDark"&gt;@color/PrimaryColorDark&lt;/item&gt;
      &lt;item name="colorAccent"&gt;@color/PrimaryColor&lt;/item&gt;
      &lt;item name="colorControlHighlight"&gt;@color/ControlHighlight&lt;/item&gt;
      &lt;item name="android:statusBarColor" tools:targetApi="21"&gt;@android:color/transparent&lt;/item&gt;
  &lt;/style&gt;
  
  
  &lt;style name="ActionBarPopupThemeOverlay" parent="ThemeOverlay.AppCompat.Light" &gt;
      &lt;item name="android:textColor"&gt;#000000&lt;/item&gt;
  &lt;/style&gt;
  
  
  &lt;style name="MyCustomTabLayout" parent="Widget.Design.TabLayout"&gt;
      &lt;item name="tabIndicatorColor"&gt;#FFFFFF&lt;/item&gt;
      &lt;item name="tabIndicatorHeight"&gt;3dp&lt;/item&gt;
      &lt;item name="tabTextAppearance"&gt;@style/MyCustomTabTextAppearance&lt;/item&gt;
  &lt;/style&gt;
  
  
  &lt;style name="MyCustomTabTextAppearance" parent="TextAppearance.Design.Tab"&gt;
      &lt;item name="android:textColor"&gt;#FFFFFF&lt;/item&gt;
  &lt;/style&gt;
  </code></pre>
  
  <p><strong>toolbar.xml</strong></p>
  
  <pre><code>&lt;android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  android:layout_height="@dimen/abc_action_bar_default_height_material"
  android:elevation="0dp"
  android:layout_width="match_parent"
  android:id="@+id/toolbar"
  android:background="@color/PrimaryColor"
  app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
  app:popupTheme="@style/ActionBarPopupThemeOverlay"/&gt;
  </code></pre>
  
  <p><strong>Class (not Fragment)</strong>:</p>
  
  <pre><code>public class WebViewCanale extends AppCompatActivity {
  
      Toolbar toolbar;
      TextView textView;
      WebView webView;
      ProgressBar progressBar;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.webview_canali);
  
          getSupportActionBar().setDisplayHomeAsUpEnabled(true);
          getSupportActionBar().setDisplayShowHomeEnabled(true);
  
          //Toolbar
          toolbar = (Toolbar) findViewById(R.id.toolbar);
          setSupportActionBar(toolbar);
  
  
          //FindViewById
          webView = (WebView) findViewById(R.id.webview);
          textView = (TextView) findViewById(R.id.textView);
          progressBar = (ProgressBar) findViewById(R.id.progressBar);
  
          //Impostazioni WebView
          WebSettings webSettings = webView.getSettings();
          webSettings.setJavaScriptEnabled(true);
          webSettings.setLoadsImagesAutomatically(true);
          webView.loadUrl(this.getIntent().getDataString());
          webView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
          webView.getSettings().setAppCacheEnabled(false);
  
          //Titolo Toolbar
          webView.setWebChromeClient(new WebChromeClient() {
              @Override
              public void onReceivedTitle(WebView view, String title) {
                  super.onReceivedTitle(view, title);
                  if (!TextUtils.isEmpty(title)) {
                      WebViewCanale.this.setTitle(title);
                  }
              }
          });
      }
  }
  </code></pre>