title: How to check "user email already exists" in firebase using Android Studio
body: <p>I'm trying to change my code. But, its failed. My output still the same. Which is, if the user put an email that is already exist or not already exist. The validation "This email has been registered." still came out. Why? Can someone whats wrong with my coding?</p>
  
  <p>Here are my method:-</p>
  
  <pre><code>public boolean isCheckEmail(final String email)
  {
      mAuth.fetchProvidersForEmail(email).addOnCompleteListener(new OnCompleteListener&lt;ProviderQueryResult&gt;()
      {
          @Override
          public void onComplete(@NonNull Task&lt;ProviderQueryResult&gt; task)
          {
              boolean check = !task.getResult().getProviders().isEmpty();
  
              if(check)
              {
                  Toast.makeText(Signup.this, "This email has been registered.", Toast.LENGTH_SHORT).show();
              }
  
              else
              {
                  Toast.makeText(Signup.this, "This email has been registered.", Toast.LENGTH_SHORT).show();
              }
          }
      });
      return true;
  }
  </code></pre>
  
  <p>While this half coding, I'm trying to call back the method isCheckEmail:-</p>
  
  <pre><code> private void RegisterAccount(String firstname, String lastname, String email, String password, String confirmpass)
  {
      if (TextUtils.isEmpty(email))
      {
          Toast.makeText(Signup.this, "Enter your email address.", Toast.LENGTH_SHORT).show();
      }
  
      else if (!isValidEmail(email)) {
          Toast.makeText(Signup.this,"Please enter your valid email address.",Toast.LENGTH_SHORT).show();
      }
  
      else if (!isCheckEmail(email))
      {
          Toast.makeText(Signup.this, "This email has been registered.", Toast.LENGTH_SHORT).show();
      }
  </code></pre>