title: How do you handle the Back button in action bar?
body: <p>I tried with this but nothing happens.</p>
  
  <pre><code>@Override
  public void onBackPressed() {
      super.onBackPressed();
      Log.d("TEST", "Pressed the Back button.");
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/rojyQ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rojyQ.jpg" alt="enter image description here"></a></p>