title: How to trigger onPause programmatically in android activity
body: <p>I am trying to work out how I can simulate pausing an activity for debugging my app. I want onPause to be called but NOT onStop. I just want to try a pause resume cycle and am looking for some code i can call (e.g. after a button press) to trigger this.</p>
  
  <p>Any ideas how?</p>
  
  <p>I have seen people suggest pressing the home button in other threads but when I do this is stops the app and calls onStop as well as onPause so it isn't quite what I was looking for. </p>