How to call a Detail Activity
blfernandez opened this issue · 2 comments
How to Call a CustumerDetail, for update and delete?
override fun onBindViewHolder(baseHolder: RecyclerView.ViewHolder, basePosition: Int) {
super.onBindViewHolder(baseHolder, basePosition)
val position = baseHolder.adapterPosition
when (getItemViewType(basePosition)) {
VIEW_TYPE_ITEM -> {
val holder = baseHolder as CustomerViewHolder
val item = items[position] as Customer
val binding = holder.binding
binding.customer = item
if (!binding.root.hasOnClickListeners()) {
binding.root.setOnClickListener {
// val clickedPosition = holder.adapterPosition
// val clickedItem = items[clickedPosition] as Customer
}
}
}
}
}
Hello @blfernandez
There is no Customer Detail Activity in Sample app.
You can surely add one, by passing the customer object (POJO)
to new CutsomerDetailActivity / CustomerDetailFragment and display customer details
If you want additional data to display you can use searchRead
for that.
Ready