將清除改為註冊
註冊介面依照自己喜好設計
可以寫入任意資料,bean 也依照自己喜好設計
data class bean(
var account: String,
var password: String,
var name: String,
var school: String,
var random_id: String,
var rank: String,
var score: Int,
var win: Int,
var lose: Int
)
private fun write(){
val bean = bean("aa26645675","1234","Deron","建國中學",
"ks557","牌位等級",8,33,13)
db.collection("personalData").add(bean)
.addOnSuccessListener {
Toast.makeText(this,"新增成功",Toast.LENGTH_SHORT).show()
}
.addOnFailureListener {
Toast.makeText(this,"新增失敗",Toast.LENGTH_SHORT).show()
}
}