Last active
September 28, 2019 19:38
-
-
Save abhinavraj23/690f493e0b1f0da18ee44b46e322dabe to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mAuth.createUserWithEmailAndPassword(email, password) | |
| .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() { | |
| @Override | |
| public void onComplete(@NonNull Task<AuthResult> task) { | |
| if (task.isSuccessful()) { | |
| // Sign in success, update UI with the signed-in user's information | |
| Log.d(TAG, "createUserWithEmail:success"); | |
| FirebaseUser user = mAuth.getCurrentUser(); | |
| updateUI(user); | |
| } else { | |
| // If sign in fails, display a message to the user. | |
| Log.w(TAG, "createUserWithEmail:failure", task.getException()); | |
| Toast.makeText(EmailPasswordActivity.this, "Authentication failed.", | |
| Toast.LENGTH_SHORT).show(); | |
| updateUI(null); | |
| } | |
| // ... | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment