方案一:加show监听,然后强制弹出即可 

 AlertDialog dialog = new AlertDialog.Builder(context)
                .setView(customView)
                .setCancelable(isCancelable).create();
        dialog.setOnShowListener(new DialogInterface.OnShowListener() {
            @Override
            public void onShow(DialogInterface dialogInterface) {
                KeyboardUtils.showSoftInput(context);
            }
        });

方案二:设置点击事件,然后强制弹出

https://blog.csdn.net/qulonglong110/article/details/80269792?utm_medium=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7EBlogCommendFromMachineLearnPai2%7Edefault-1.control&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7EBlogCommendFromMachineLearnPai2%7Edefault-1.control

方案三:延时强制弹框

 

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐