Android Dialog Box without buttons

前端 未结 9 2523
余生分开走
余生分开走 2021-02-19 06:52

Can i create a dialog box without negative or positive buttons. That destroys it self after specific action?

 AlertDialog.Builder dialog_detect= new AlertDialog.         


        
9条回答
  •  再見小時候
    2021-02-19 07:11

    You can try custom dialog as you like

    Dialog dialog_help = new Dialog(this);
    dialog_help.setContentView(R.layout.title_multi_selectitems_dialog);
    EditText et_1 = (EditText) dialog_help.findViewById(R.id.et_help_1);
    dialog_help.setCancelable(true);
    dialog_help.setTitle("   Help   ");
    dialog_help.setCanceledOnTouchOutside(true);
    dialog_help.show();
    dialog_help.getWindow().setGravity(Gravity.CENTER);
    dialog_help.getWindow().setLayout(LayoutParams.MATCH_PARENT,LayoutParams.WRAP_CONTENT);
    

提交回复
热议问题