title: How do I manually pause an activity in Android?
body: <p>When you press the back button in Android it calls finish() under the hood, and I want it to be replaced with a pause behavior, and I have found no documentation that let's you trigger that manually.</p>
  
  <p>EDIT: Ok, this needs more code I guess</p>
  
  <pre><code>public boolean onKeyDown(int keyCode, KeyEvent event)
  {
      int Action = event.getAction();
      if (Action == KeyEvent.ACTION_DOWN)
      {
          if (event.getKeyCode() == KeyEvent.KEYCODE_BACK)
          {
           //Default Implementation calls finish();
           //I want to call Pause, which should call onPause and then send my app in the background !
  
            }
        }
  }
  </code></pre>
  
  <p>I just tried onBackPressed, it doesn't even get hit with the above code on Android 4.3 at least. I tried manually calling onPause() but that just renders my app into an invalid state.</p>