title: Screen jumps after hiding keyboard
body: <p>I'm <strong><em>not</em></strong> asking how to prevent keyboard from pushing up the screen when it pops up.</p>
  
  <p>When I click an <code>EditText</code> the keyboard shows up, and the screen remains unchanged. But the problem is when I click outside the <code>EditText</code>, the keyboard hides <strong><em>and then</em></strong> (after about half a second) the screen jumps a little (leaving a white background at the bottom) and then settles back down.</p>
  
  <p>I'm using a custom Keyboard and a custom EditText.</p>
  
  <p>In the activity I've set:</p>
  
  <p><code>getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);</code></p>
  
  <p>And when the <code>EditText</code> gains focus this is how I show up the keyboard:</p>
  
  <pre><code>InputMethodManager inputMethodManager = (InputMethodManager)MainApplication.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
  inputMethodManager.showSoftInput( view, 0 );
  </code></pre>
  
  <p>And hide it when <code>EditText</code> loses focus:</p>
  
  <pre><code>InputMethodManager inputMethodManager = (InputMethodManager)MainApplication.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
  inputMethodManager.hideSoftInputFromWindow(view.getWindowToken(), 0);
  </code></pre>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Not that when I press <strong>DONE</strong> on the keyboard, the keyboard just hides (without the screen jumping) but the EditText doesn't lose focus. So if it's possible to just simulate a <strong>DONE</strong> press when the <code>EditText</code> is about to lose focus, this would be fine with me.</p>