title: Firestore OncompleteListener
body: <p>I want to see what is the error in this code for the executiom, when i compile it it just returns the values of log 1,3,2 , and i wanto log 2 to be before the 3</p>
  
  <pre><code>Log.d("1", "antes de validar");
      DocumentReference docRef = db.getDb().collection("Usuarios").document(Correo);
      docRef.get().addOnCompleteListener(new OnCompleteListener&lt;DocumentSnapshot&gt;() {
          @Override
          public void onComplete(@NonNull Task&lt;DocumentSnapshot&gt; task) {
              Log.d("2", "validar");
              if (task.isSuccessful()) {
                  DocumentSnapshot document = task.getResult();
                  if (document.exists()) {
                      setBanderaValidarCorreoDB(true);
                      return;
                  } else {
                      setBanderaValidarCorreoDB(false);
                      return;
                  }
              } else {
                  Toast.makeText(contextoRegistro, "ERROR al Realizar la validacion de Correo"+ task.getException(), Toast.LENGTH_SHORT).show();
                  setBanderaValidarCorreoDB(false);
                  return;
              }
          }
      });
      Log.d("3", "despues de validar");
      return BanderaValidarCorreoDB;
  }
  </code></pre>
  
  <p>This is how it shows</p>
  
  <pre><code>07-08 13:47:56.968 6027-6027/felipe.monumentosfinalcertamen D/1: antes de 
   validar
  07-08 13:47:56.980 6027-6027/felipe.monumentosfinalcertamen D/3: despues de validar
  07-08 13:47:57.071 6027-6052/felipe.monumentosfinalcertamen W/EGL_emulation: eglSurfaceAttrib not implemented
  07-08 13:47:57.071 6027-6052/felipe.monumentosfinalcertamen W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xe2b2a700, error=EGL_SUCCESS
  07-08 13:47:57.149 6027-6052/felipe.monumentosfinalcertamen W/EGL_emulation: eglSurfaceAttrib not implemented
  07-08 13:47:57.149 6027-6052/felipe.monumentosfinalcertamen W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xe2cf7540, error=EGL_SUCCESS
  07-08 13:47:57.177 6027-6052/felipe.monumentosfinalcertamen V/RenderScript: 0xeff9b600 Launching thread(s), CPUs 4
  07-08 13:47:58.483 6027-6027/felipe.monumentosfinalcertamen D/2: validar
  07-08 13:52:35.654 6027-6068/felipe.monumentosfinalcertamen I/FirebaseAuth: [FirebaseAuth:] Loading module via FirebaseOptions.
      [FirebaseAuth:] Preparing to create service connection to gms implementation
  </code></pre>