Skip to content

Instantly share code, notes, and snippets.

@pavan5208
Last active July 18, 2021 16:45
Show Gist options
  • Save pavan5208/9cef5180d61be8ea12e44c20631010b7 to your computer and use it in GitHub Desktop.
Save pavan5208/9cef5180d61be8ea12e44c20631010b7 to your computer and use it in GitHub Desktop.
private fun createNewUser(email: String, password: String) {
auth.createUserWithEmailAndPassword(email, password)
.addOnCompleteListener(this) { task ->
if (task.isSuccessful) {
// Sign in success, update UI with the signed-in user's information
val user = auth.currentUser
Toast.makeText(
baseContext, "Authentication Success.",
Toast.LENGTH_SHORT
).show()
startHomeActivity()
} else {
// If sign in fails, display a message to the user.
Toast.makeText(
baseContext, "Authentication failed.",
Toast.LENGTH_SHORT
).show()
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment