I have a Dialog
in which I am having a EditText
.
Issues which I am facing are:
1). When Dialog
is shown at that moment Keyboard does not come itself. So I had to programmatically bring keyboard up.
InputMethodManager immOnResume = (InputMethodManager) getActivity().getSystemService(
Context.INPUT_METHOD_SERVICE);
immOnResume.showSoftInput(mEditText,
InputMethodManager.SHOW_FORCED);
2). When pressing home button keyboard is still visible in Home screen. I think as I am programmatically bringing keyboard up then I have to programmatically hide keyboard.
InputMethodManager immN = (InputMethodManager) getActivity().getSystemService(
Context.INPUT_METHOD_SERVICE);
immN.hideSoftInputFromWindow(
mEditText.getWindowToken(), 0);
But these also isn't working. Any suggestions how can I solve my issue.