0
I used a Dialog to display a custom alert this way:
Dialog dialog = new Dialog();
dialog.setContextView(R.layout.resource);
dialog.setTitle("Diálogo");
dialog.show();
However I can’t change Dialog xml elements using this Activity.
0
I used a Dialog to display a custom alert this way:
Dialog dialog = new Dialog();
dialog.setContextView(R.layout.resource);
dialog.setTitle("Diálogo");
dialog.show();
However I can’t change Dialog xml elements using this Activity.
0
First create an element in the Java class and then retrieve it from the 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());
}
Browser other questions tagged java android
You are not signed in. Login or sign up in order to post.