1
I’m using Dialog to display a certain information in my APP, I wonder if it has any function for me to check if the dialog is already open to not open again.
public void Dialogo_Iluminacao() {
final Dialog dialog = new Dialog(this);
dialog.setContentView(R.layout.dialogo_iluminacao);
dialog.setTitle("Iluminação");
final Switch garagem = (Switch) dialog.findViewById(R.id.switchGaragem);
garagem.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
});
dialog.show();
}
I have a function that whenever something arrives in it should show this dialog and often comes several and I would like the dialog to start only once
I could not implement an example ??
– Guilherme
What do you mean you could not implement? Error, crash, was not called the method...? Post some code snippet
– rsicarelli
how do I use this function? I put it inside my method Dialogo_illumination ?
– Guilherme
Before you show your
Dialog
! You said yourself that "I have a function that whenever something arrives in it must show this dialog and often arrives several". At this point, you do this check– rsicarelli