I used a Dialog to display a custom alert like this:
Dialog dialog = new Dialog();
dialog.setContextView(R.layout.resource);
dialog.setTitle("Diálogo");
dialog.show();
But I can not change elements of the Dialog xml using this Activity.
I used a Dialog to display a custom alert like this:
Dialog dialog = new Dialog();
dialog.setContextView(R.layout.resource);
dialog.setTitle("Diálogo");
dialog.show();
But I can not change elements of the Dialog xml using this Activity.
First create an element in the Java class and then retrieve it from Dialog. For example:
public void dialogClick() {
Dialog dialog = new Dialog();
dialog.setContextView(R.layout.resource);
dialog.setTitle("Diálogo");
dialog.show();
View = dialog.findViewById(R.id.sua_view);
view.setOnClickListener(ASuaListener());
}