I want to automatically show the soft-keyboard when an EditText
is focused (if the device does not have a physical keyboard) and I have two problems:
When my
Activity
is displayed, myEditText
is focused but the keyboard is not displayed, I need to click again on it to show the keyboard (it should be displayed when myActivity
is displayed).And when I click done on the keyboard, the keyboard is dissmissed but the
EditText
stays focused and y don't want (because my edit is done).
To resume, my problem is to have something more like on the iPhone: which keep the keyboard sync with my EditText
state (focused / not focused) and of course does not present a soft-keyboard if there is a physical one.
code snippet . . .
add this line too do not forget
When nothing else works, force it to be shown:
In your onResume() section of the Activity you can do call the method bringKeyboard();
It worked for me. You can try with this also to show the keyboard:
I made this help class. Just pass the context and the View you want to focus and show keyboard and after hide keyboard. I hope it Helps.
}