How can I display a dialog above the keyboard

后端 未结 4 1685
野性不改
野性不改 2021-02-09 17:48

I\'m a newbie with android, I write an application which using the Dialog to display data when user select on one thing. This is how the dialog looks:

https://docs.googl

4条回答
  •  轮回少年
    2021-02-09 18:31

     AlertDialog dialog = new AlertDialog.Builder(this).create();
     dialog.show();
     Window window = dialog.getWindow();
     window.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);
     window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
    

提交回复
热议问题