Answers for "open close dialog"

1

close dialog android

if (dialog.isShowing) {
     dialog.dismiss()
}
Posted by: Guest on August-25-2020
0

code to close dialog containg layout

AlertDialog.Builder builder = new AlertDialog.Builder(this);

    LayoutInflater inflater = getLayoutInflater();
    View dialogView = inflater.inflate(R.layout.brush_opts_dialog,null);

    builder.setView(dialogView);


    closeBtn = (Button)dialogView.findViewById(R.id.close_btn);


   final AlertDialog dialog = builder.create();

    closeBtn .setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            dialog.dismiss();
        }
    });

    dialog.show();
Posted by: Guest on August-18-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language