Search code examples
androidspinnersoft-keyboard

Open keyboard for EditText inside a TextView


I have a Spinner(inside a dialog) that contains an EditText as one of its element. The problem is that no keyboard is shown when I click inside the EditText. I tried various methods like manually opening the softkeyboard with the InputMethodManager whenever there is an OnClick or OnItemSelected event occurs but none of these worked for me.

Any tips?

Thanks in advance.


Solution

  • Try this,

    InputMethodManager m = (InputMethodManager) 
      if(m != null){
          m.toggleSoftInput(0, InputMethodManager.SHOW_IMPLICIT);
       }