开发者

Open keyboard for EditText inside a TextView

开发者 https://www.devze.com 2023-03-30 14:32 出处:网络
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 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.


Try this,

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

精彩评论

暂无评论...
验证码 换一张
取 消