Android: Why is my soft keyboard hiding after these key events?
<p>I have a WebView in my Android Application that is giving me a problem. At first was not handling the keyDown event correctly for the arrow keys, and I had to catch the keyDown and use Javascript like this to process them correctly:</p>

<pre><code>    @Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
    Log.v(TAG, "KeyCode: " + keyCode + "    KeyEvent: " + event);
    switch(keyCode) {
    case 19: /* Up */
        this.loadUrl("javascript:editor.setCursor(editor.getCursor().line - 1, editor.getCursor().ch);");
    case 20: /* Down */
        this.loadUrl("javascript:editor.setCursor(editor.getCursor().line + 1, editor.getCursor().ch);");
    case 21: /* Left */
        this.loadUrl("javascript:editor.setCursor(editor.getCursor().line, editor.getCursor().ch - 1);");
    case 22: /* Right */
        this.loadUrl("javascript:editor.setCursor(editor.getCursor().line, editor.getCursor().ch + 1);");
    }
    return super.onKeyDown(keyCode, event);
}
</code></pre>

<p>But now I am getting an issue that every time I use one of the arrow keys the soft keyboard is hiding. </p>

<p>I found one other question here on Stackoverflow that seems to be the exact same issue, but nobody answered him:</p>

<p><a href="http://stackoverflow.com/questions/8016430/prevent-buttons-from-hiding-soft-keyboard-on-android">Prevent Buttons From Hiding Soft Keyboard On Android</a></p>

<p>Is there some way I can prevent the softkeyboard from hiding on me?</p>
