Have a class with constructor(work well): ``` clas...
# announcements
m
Have a class with constructor(work well):
Copy code
class BreakdownChartViewHolder(parent: ViewGroup?, listener: CategoryDetailsClickListener? = null)
    : RecyclerView.ViewHolder(
        parent?.inflateListItemView(R.layout.list_item_breakdown_chart_view)?.apply {
            listener?.let { (findViewById(R.id.categoryBreakdownChartView) as? CategoryBreakdownChartView)?.itemClickListener = it}
        }) {
Now i want to divide this code to two constructors:
Copy code
class BreakdownChartViewHolder(parent: ViewGroup?)
    : RecyclerView.ViewHolder(parent?.inflateListItemView(R.layout.list_item_breakdown_chart_view)) {

    constructor(parent: ViewGroup?, listener: CategoryDetailsClickListener? = null) : this(parent) {
        parent?.inflateListItemView(R.layout.list_item_breakdown_chart_view)?.apply {
            listener?.let { (findViewById(R.id.categoryBreakdownChartView) as? CategoryBreakdownChartView)?.itemClickListener = it }
        }
    }
but this implementation doesn t work for me (