Skip to content

Instantly share code, notes, and snippets.

@rlarla245
Created February 22, 2019 11:10
Show Gist options
  • Select an option

  • Save rlarla245/e8b9d0da62298f05fbacb1fee7f38050 to your computer and use it in GitHub Desktop.

Select an option

Save rlarla245/e8b9d0da62298f05fbacb1fee7f38050 to your computer and use it in GitHub Desktop.
Firebase 이메일 변경
Firebase 이메일 주소 바꾸기
// 마찬가지로 버튼을 생성해줍니다.
// 다이얼로그로 처리해줍시다.
button.setOnClickListener {
var editTextNewId = EditText(this)
var alertDialog = AlertDialog.Builder(this)
alertDialog.setView(editTextNewId)
alertDialog.setTitle("아이디 변경")
alertDialog.setMessage("변경 아이디")
alertDialog.setPositiveButton("확인", {dialogInterface, i -> changeId(editTextNewId.text.toString())})
alertDialog.setNegativeButton("취소", {dialogInterface, i -> })
alertDialog.show()
}
1. 변경 메소드를 만들어줍니다.
fun changeId() {
FirebaseAuth.getInstance().currentUser!!.updateEmail(email)
.addOnCompleteListener { task ->
if (task.isSuccessful) {
Toast("변경 완료")
} else {
Toast("취소")
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment