Sign in with email and password

Advertisements
FirebaseAuth firebaseAuth = FirebaseAuth.getInstance();
        firebaseAuth.signInWithEmailAndPassword(email, password).addOnCompleteListener(
            new OnCompleteListener<AuthResult>() {
              @Override
              public void onComplete(@NonNull Task<AuthResult> task) {

                if (task.isSuccessful()) {
                  startActivity(new Intent(SignInActivity.this, MainActivity.class));
                  finish();
                } else {
                  Snackbar
                      .make(root, task.getException().getLocalizedMessage(), Snackbar.LENGTH_LONG)
                      .show();
                }
              }
            });