I am trying to display a Dialog with an EditText field, pre-populate the EditText with a default value, select all in the EditText, give the focus to the EditText, and automatically pop open the keyboard.
However as soon as I show the Dialog, the keyboard retracts. If I display the Dialog first, the keyboard won’t display.
I am displaying the keyboard with
InputMethodManager inputMethodManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
inputMethodManager.showSoftInput(getView(), 0);
What to do?
Try With this..write on Your Dialog setOnShowListener method.like this before your alert dialog.show() method…
i tried with this..it’s worked for me.