Firestore Database Accessing Code in Activitymain.xml
db.collection("billNo") // I think want to add some code here to get the data!!//
.get()
.addOnSuccessListener {
user.clear()
for (document in it) {
user.add(User(
document.id,
document.data.get("billNo").toString().toInt(),
document.data.get("date").toString(),
document.data.get("name").toString(),
document.data.get("amount").toString().toInt(),
document.data.get("payment").toString()
)
)
}
Database Structure
@Parcelize
data class User(
val id: String,
val billNo: Int,
val date: String,
val name: String,
val amount: Int,
var payment:String
) : Parcelable
I Add billNo, date, name, amount, paid_or_unpaid data into the FIREBASE DATABASE. So when I click on searching I want to get details of the selected month in the RecyclerView. All RecyclerView code and other things working perfectly fine. Only I want to retrieve the data of the selected month.
When I click on the Respective Month & Year in the Following Activity (Screenshot is provided below) I want to get the details of bills in the respective month from the FIREBASE FIRE STORE DATA Base. I tried a lot. but I can't find a solution. I'm doing my project on Android Studio with KOTLIN programming Language.