首页 > 学院 > 开发设计 > 正文

EditText自动获取焦点并弹出输入法

2019-11-09 17:04:17
字体:
来源:转载
供稿:网友
public void showSoftInputFromWindow(Activity activity, EditText editText) { editText.setFocusable(true); editText.setFocusableInTouchMode(true); editText.requestFocus(); activity.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE); }
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表