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
In 2019 this work for me. You can change text view with button.
Dialog mdialog = new Dialog(this);
mdialog.setContentView(R.layout.activity_select_type);
mdialog.show();
TextView view = mdialog.findViewById(R.id.viewQuotes);
view.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Toast.makeText(MainActivity.this, "Working...", Toast.LENGTH_SHORT).show();
}
});