Android – Programmatically Hide/Show Soft Keyboard [duplicate]

This question already has answers here: Closed 10 years ago. Possible Duplicate: How do you close/hide the Android soft keyboard programmatically? First thing first I already saw this thread. I tried the accepted methods given there, but nothing worked for me. I have two screens in my app. First one has 2 EditText – One … Read more

Android: show soft keyboard automatically when focus is on an EditText

I’m showing an input box using AlertDialog. The EditText inside the dialog itself is automatically focused when I call AlertDialog.show(), but the soft keyboard is not automatically shown. How do I make the soft keyboard automatically show when the dialog is shown? (and there is no physical/hardware keyboard). Similar to how when I press the … Read more

How do you close/hide the Android soft keyboard programmatically?

I have an EditText and a Button in my layout. After writing in the edit field and clicking on the Button, I want to hide the virtual keyboard when touching outside the keyboard. I assume that this is a simple piece of code, but where can I find an example of it? 12 125