【发布时间】:2021-03-29 21:24:02
【问题描述】:
有人可以帮我解决这个错误吗?我正在尝试从 DatePicker 组件中获取生日日期,并将其保存在 Firebase Firestore 中,但出现此错误:
java.lang.RuntimeException:在类 android.widget.DatePicker 上发现名称 getOverlay 的 getter 冲突
DatePicker 组件是名为 dtNascimento 和 etDtNascimento 的变量
private fun createNewAccount() {
nome = etNome!!.getText().toString()
cpf = etCpf!!.getText().toString()
dtNascimento = etDtNascimento
if (TextUtils.isEmpty(nome) || TextUtils.isEmpty(cpf)){
Toast.makeText(this, "Entre com mais detalhes!", Toast.LENGTH_SHORT).show()
}else{
val user = hashMapOf<String, Any?>(
"nome" to nome,
"cpf" to cpf,
"dtNascimento" to dtNascimento
)
db.collection("pessoas")
.add(user)
.addOnSuccessListener {documentReference->
Log.d(tag, "DocumentSnapshot added with ID: ${documentReference.id}\"")
}
.addOnFailureListener{e->
Log.w(tag, "Error adding document", e)
}
Toast.makeText(this, "Informações preenchidas com sucesso!", Toast.LENGTH_SHORT).show()
updateUserInfoAndUI()
}
}
【问题讨论】:
-
对不起,弗兰克,我忙于编码,忘记就您的回答提供反馈。是的,它帮助了我,非常感谢!
标签: android firebase kotlin google-cloud-firestore