Android显示软键盘

public static void show(final EditText content){
content.setFocusable(true);
content.setFocusableInTouchMode(true);
content.postDelayed(new Runnable() {
@Override
public void run() {
InputMethodManager imm = (InputMethodManager) content.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
if (imm != null) {
content.requestFocus();
imm.showSoftInput(content, 0);
}
}
},200);
}

 

posted @ 2019-03-25 17:09  yklszm  阅读(134)  评论(0编辑  收藏  举报