June 2018
Beginner to intermediate
394 pages
9h 2m
English
Sign in also looks for two string parameters, which are valid email address and password. However, here, we will make use of another method called signInWithEmailAndPassword. We need to attach addOnCompleteListener and with its callbacks, as shown:
mAuth.signInWithEmailAndPassword(email, password) .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() { @Override public void onComplete(@NonNull Task<AuthResult> task) { if (task.isSuccessful()) { // Successful signin Log.d(TAG, "signInWithEmail:success"); FirebaseUser user = mAuth.getCurrentUser(); updateUI(user); } else { // failed for some reason Log.w(TAG, "signInWithEmail:failure", task.getException()); Toast.makeText(MainActivity.this, "Authentication ...
Read now
Unlock full access