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
  • 14,818
  • 17
  • 56
  • 108

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
  • 46,951
  • 13
  • 114
  • 146