I’m having trouble with my code or rather fetching the data from my firebase firestore database. The weird thing here is that every other field ASIDE from id can be readable. I already read the logcat and its I’m getting a null id or rather its not getting any id.
Here is my code for my Adapter:
holder.cardView.setOnClickListener {
val intent = Intent(context, UpdateTenantActivity::class.java).apply {
putExtra("room_number", tenant.id)
Log.d("TenantAdapter", "Room ID being passed: ${tenant.id}")
}
context.startActivity(intent)
// onUpdateTenant(tenant.room_number)
}
Here is the code for my data class
data class Tenant(
val id: String = "",
val room_number: String = "",
val kost_name: String = "",
val first_name: String = "",
val phone_number: String = "",
val floor_number: String = "",
val room_ac: String = "",
val water_heater: String = "",
val room_clean: String = "",
val room_vacancy: String = "",
val ampere_number: String = "",
val room_note: String = ""
)
Recognized by Mobile Development Collective and Google Cloud Collective
1