title: PopUp do something if the condition is met
body: <p>So I made a custom dialog where it asks for information(like a feedback.
  I want the app to check if all the EditTexts have value,
  this is my java for opening feedback dialog</p>
  
  <pre><code>private void dialog() {
      myDialog.setContentView(R.layout.activity_pop_up);
      editTextEmailValue = (EditText) myDialog.findViewById(R.id.editTextEmail);
      editTextMessageValue = (EditText) myDialog.findViewById(R.id.editTextMessage);
      editTextNumeValue = (EditText) myDialog.findViewById(R.id.editTextNume);
      Button btnSend = (Button) myDialog.findViewById(R.id.sendBtn);
      Button btnClose = (Button) myDialog.findViewById(R.id.close);
  
      btnSend.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View view) {
           //This is what I've tried (the check method is bewlow)
              if (check() &gt; 1) {
                  editTextNumeValue.setError("Obligatoriu!");
                  editTextMessageValue.setError("Obligatoriu!");
                  editTextEmailValue.setError("Obligatoriu!");
              } else if (check() == 0) {
                  sendMail();
              }
          }
      });
      btnClose.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View view) {
              myDialog.dismiss();
          }
      });
      myDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
      myDialog.show();
  }
  </code></pre>
  
  <p>And this is my check method :</p>
  
  <pre><code> private int check() {
      int counter = 0;
      if (editTextEmailValue.equals("")) {
          editTextEmailValue.setError("Obligatoriu!");
          counter++;
      } else if (editTextMessageValue.equals("")) {
          counter++;
          editTextMessageValue.setError("Obligatoriu!");
      } else if (editTextNumeValue.equals("")) {
          editTextNumeValue.setError("Obligatoriu!");
          counter++;
      }
      return (counter);
  }
  </code></pre>
  
  <p>When I press the send button(for email) it enters the check method and goes out with 0 1 2 3 (I have only 3 textView) but when it checks in the <code>btnSend.onClickListener</code> if the condition are met it still send the mail so from that I can say from check method the counter have value 0 all the time so can you help me?</p>