Created
May 1, 2019 17:25
-
-
Save nitesh-singh-1307/c7d69f8f60073406ae9fc133f2005e93 to your computer and use it in GitHub Desktop.
log in with email id
This file contains 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("axy@gmail.com", "123456") | |
.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("CreateUser", "createUserWithEmail:success"); | |
FirebaseUser user = mAuth.getCurrentUser(); | |
updateUI(user); | |
} else { | |
// If sign in fails, display a message to the user. | |
Log.w("CreateUserWithemail", "createUserWithEmail:failure", task.getException()); | |
Toast.makeText(MainActivity.this, "Authentication failed.", | |
Toast.LENGTH_SHORT).show(); | |
updateUI(null); | |
} | |
// ... | |
} | |
}); | |
// create a method | |
private void updateUI(FirebaseUser user) { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment