title: Pause Activity when the AlertDialog is shown
body: <p>I am aware that, since <code>AlertDialog</code> is part of a presenting <code>Activity</code>, showing it doesn't trigger <code>OnPause</code> of the <code>Activity</code>. What I want to achieve is to show <code>AlertDialog</code> and somehow trigger <code>OnPause</code> of the presenting <code>Activity</code>. </p>
  
  <p>In the <code>OnResume</code> I set <code>OnGlobalLayoutListener</code> to adjust the position of the scrollview based on whether the keyboard is visible. However, if an <code>AlertDialog</code> is visible then it probably doesn't make sense to keep listening to the layout changes and adjusting the scrollview accordingly, considering the "focus" is currently on the <code>AlertDialog</code> and the <code>Activity</code> is partially visible in background.</p>
  
  <p>I am aware that I can start activity with "popup" style but this is not what I want; I want to use <code>AlertDialog</code>.</p>