Advertisements

Create user with email and password

firebaseAuth.createUserWithEmailAndPassword(email, pass).addOnCompleteListener(
              new OnCompleteListener<AuthResult>() {
                @Override
                public void onComplete(@NonNull Task<AuthResult> task) {

                  if (task.isSuccessful()) {
                    startActivity(new Intent(SignUpActivity.this, MainActivity.class));
                    finish();
                  } else {
                    Snackbar.make(mRlRoot, task.getException().getMessage(), Snackbar.LENGTH_LONG)
                        .show();
                  }

                }
              });