when using AlertDialog.Builder with EditText, the Soft Keyboard doesn't pop

前端 未结 12 1328
一生所求
一生所求 2020-11-30 23:13

I am using AlertDialog.Builder in order to create an input box, with EditText as the input method.

Unfortunately, the Soft Keyboard doesn\'t pop, al

12条回答
  •  臣服心动
    2020-11-30 23:52

    final AlertDialog.Builder alert = new AlertDialog.Builder(context);
    
    final AlertDialog dialog = alert.show();
    dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
    

提交回复
热议问题