2

I have an external button that SHOULD clear/hide the soft keyboard when it is pressed, but the edittext IS IN FOCUS!

All these tips are not for the same use case.

Close/hide the Android Soft Keyboard

I've even tried clearFocus()

Basically I want to simulate an imeDone event!

Community
  • 1
  • 1
hunterp
  • 15,716
  • 18
  • 63
  • 115

1 Answers1

2

Add this for your activity in your manifest

android:windowSoftInputMode="stateAlwaysHidden"

Another approach is to move the focus to another view, e.g: transfer the focus to the layout

    mylayout.requestFocus()
Nikola Despotoski
  • 49,966
  • 15
  • 119
  • 148