I have made a main Dialog class on which I send the layout ID and shows the layout as a Dialog now when I send the layout from calling class it pop
Dialog
dialog = new Dialog(this); dialog.setContentView(R.layout.custom_dialog); dialog.setTitle("Custom Dialog"); Button dialog_btn = (Button) dialog.findViewById(R.id.dialog_button); dialog_btn.setOnClickListener(new View.OnClickListener() { // Perform button logic }