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

前端 未结 12 1300
一生所求
一生所求 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:57

    I've made such a thing

    AlertDialog.Builder b = new AlertDialog.Builder(this);//....
    AlertDialog dialog = b.create();
    
    dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
    
    dialog.show();
    

提交回复
热议问题