I am using Dialog to display some information in my APP, I would like to know if there is any function for me to check if the dialog is already open so it will 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 arrives several and would like the dialog to initialize only once