自定义dialog中EditText无法弹出输入法

AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
final AlertDialog dialog1 = builder.create();
dialog1.setCanceledOnTouchOutside(false);
dialog1.show();
Window window = dialog1.getWindow();

LayoutInflater inflater = (LayoutInflater)getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View view = inflater .inflate(R.layout.dialog_login_jihuo_user, null);

window.setContentView(view);


/**主要是这两句,弹出输入法弹出*/
window.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);



ivJBack = (ImageView) view.findViewById(R.id.iv_dialog_login_jihuo_back);
etJName = (EditText) view.findViewById(R.id.tv_dialog_login_jihuo_name);
etJOldpwd = (EditText) view.findViewById(R.id.tv_dialog_login_jihuo_oldpwd);
etJNewpwd = (EditText) view.findViewById(R.id.tv_dialog_login_jihuo_newpwd);
etJNewpwdagain = (EditText) view.findViewById(R.id.tv_dialog_login_jihuo_newpwd_again);
btnJOk = (Button) view.findViewById(R.id.btn_dialog_login_jihuo_ok);

你可能感兴趣的:(自定义dialog中EditText无法弹出输入法)