I have a WebView and some buttons in my layout. There is a large tag in my WebView. This app is used to edit text files. The buttons are used to effect the textarea inside my WebView. When the user presses a button (Such as an Arrow Button to Move the text view) it closes the keyboard. I have used toggleSoftInput, but that just toggles the keyboard to show or not. I want the buttons to stop hiding the soft keyboard when the button is pressed. I have found nothing about my specific problem. I have searched for weeks. Anybody have any idea on how I can stop my Buttons from hiding the Soft Keyboard on Android?
The solution to your problem might be to keep the keyboard always shown and letting the user to close it when the actions are done.
InputMethodManager inputManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
inputManager.toggleSoftInput (InputMethodManager.SHOW_FORCED, InputMethodManager.HIDE_IMPLICIT_ONLY);
Try this code in the onCreate() method of your Activity. Note that if the user presses the close button on the keyboard or the back button it should close it. And I guess you shouldn't interfere with that scenario. And when the actions are done you can then close the keyboard from code.