问题很无厘头,方法很简单: 加上这句代码就好了
alertDialog.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM)