Android: Force EditText to remove focus?

Alex1987 picture Alex1987 · Feb 20, 2011 · Viewed 390.1k times · Source

I would like to be able to remove the focus from the EditText. For example if the Keyboard appears, and the user hides it with the back button, I would like the focus and the cursor to disappear. How can it be done?

Answer

xtr picture xtr · May 25, 2011

You can make cursor and focus disappear by

edittext.clearFocus();

But detect when the key board hide is a hard work.