Closing the soft keyboard with a button
in
Android Processing
•
2 years ago
Hello,
I have a text field and a Button declared like this
APEditText textField;
APButton buttonSetText;
All of this is working very well on my app. I can write text in the text field, ...
Now I want to close the soft keyboard by clicking on the button (usually you click on escape with the emulator or the return switch on the phone).
I found many informations on that page
I made this function, but the soft keyboard window is not closing in the emulator nor the phone.
void onClickWidget(APWidget widget){
if(widget == buttonSetText){ //if it was buttonSetText that was clicked
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
}
Any ideas ?
3