Doubt with Dialog

Asked

Viewed 196 times

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

2 answers

1


  • I could not implement an example ??

  • What do you mean you could not implement? Error, crash, was not called the method...? Post some code snippet

  • how do I use this function? I put it inside my method Dialogo_illumination ?

  • 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

0

Browser other questions tagged

You are not signed in. Login or sign up in order to post.