This question already has an answer here:
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?
you have to remove
<requestFocus/>
if you don't use it and still the same problem
user
LinearLayout
as a parent and setHope it's help you.
Add these two properties to your parent layout (ex: Linear Layout, Relative Layout)
It will do the trick :)
Add to your parent layout where did you put your
EditText
thisandroid:focusableInTouchMode="true"
To hide the keyboard when activity starts.. write the following code in onCreate()..
To clear focus and remove cursor from edittext.....
You can also include
android:windowSoftInputMode="stateAlwaysHidden"
in your manifest action section.This is equivalent to:
Remove focus but remain focusable:
EditText will lose focus, but can gain it again on a new touch event.