android - show soft keyboard on demand

后端 未结 2 826
说谎
说谎 2020-12-07 05:59

Hi I wrapped edittext control onto a control that is being displayed on the screen at users request. It overlays the whole screen until user presses \'done\' button on the k

2条回答
  •  借酒劲吻你
    2020-12-07 06:32

    In your showKeyboard function you are calling:

     imm.hideSoftInputFromWindow(this._textView.getWindowToken(), InputMethodManager.SHOW_IMPLICIT);
    

    This will hide the softInput keyboard from the window! Do you want to show the keyboard? If yes then would you use:

     imm.showSoftInput(view, flags, resultReceiver);
    

    EDIT: I think you can also toggle the keyboard from the InputMethodManager, try:

     imm.toggleSoftInput(0, 0);
    

提交回复
热议问题