How to make keylistener in Edit text in android?
<p>I have a Edit text named as password when I enter value and press done it clear focus from password edit text and when I press device back then it not lossing focus from password edit text.</p>

<p><strong>Code</strong></p>

<pre><code>m_InputPassword.setOnEditorActionListener(new TextView.OnEditorActionListener() {
        @Override
        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
            if (actionId== EditorInfo.IME_ACTION_DONE || actionId==EditorInfo.IME_ACTION_NEXT|| event.getAction()==KeyEvent.KEYCODE_BACK){
                m_InputPassword.clearFocus();

            }
            return false;
        }
    });
</code></pre>