Android how to clear focus of edit text on closing keyboard
<p>I am trying to do two diffrent animate on gaining focus and on keyboard go down. I am trying to detect focus with this </p>

<pre><code>        editText.setOnFocusChangeListener(new View.OnFocusChangeListener() {
        @Override
        public void onFocusChange(View v, boolean hasFocus) {
            if(hasFocus) animateUp();
            else animateDown();
        }
    });
</code></pre>

<p>The problem is when keyboard is closed edit text is still being focused and it cant animate the second one. How can I clear the focus after keyboard closed ?</p>