Display Android Soft Keyboard

I am trying to display the soft keyboard. I have found many answers but none of them solve my problem. InputMethodManager imm = (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE); imm.showSoftInput(error[0], InputMethodManager.SHOW_IMPLICIT); error[0].requestFocus();


Try This . When you activity starts, Soft Keyboard will popup :-

    this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);

or Add this to the activity on which you want to show soft keyboard when it starts :-

android:windowSoftInputMode="stateVisible"

or if you want soft keyboard to popup on an edit text :-

    InputMethodManager imm = (InputMethodManager)getSystemService(
              Context.INPUT_METHOD_SERVICE);
        imm.showSoftInput(myEditText.getWindowToken(), 0);
链接地址: http://www.djcxy.com/p/93036.html

上一篇: 自动显示键盘

下一篇: 显示Android软键盘