#笔记#Android中自定义dialog里的EditText获取焦点时弹出软键盘输入法

        final EditText et_set_psd = (EditText) view.findViewById(R.id.et_set_psd);

        et_set_psd.setOnFocusChangeListener(new OnFocusChangeListener() {

            @Override
            public void onFocusChange(View v, boolean hasFocus) {
                if (hasFocus) {
                    dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
                }
            }
        });

 

posted on 2016-08-27 13:55  Mr.Tan  阅读(568)  评论(0)    收藏  举报