Copy this method into
public void showSoftInputFromWindow(EditText editText){
editText.setFocusable(true);
editText.setFocusableInTouchMode(true);
editText.requestFocus();
CommunityFriendCircleActivity.this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
}
CommunityFriendCircleActivity.this represents the current Activity. If you display the keyboard on the MainActivity interface, change it to MainActivity.this.
Just change it to whichever interface you want.
Just call it where you need it
showSoftInputFromWindow(mEditText);//显示键盘
mEditText is the component corresponding to your edit box