I am new to kotlin and I have added a parameter in the constructor and it throws this error? how to figure out the problem I don't understand. Any help would be appreciatable
Error public constructor AppView(context: Context, _listener: OnFragmentInteractionListener, _position: Int)defined in com.views.home.AppView @JvmOverloads public constructor AppView(mlist: StoreViewMap, context: Context, attrs: AttributeSet? = ..., defStyle: Int = ...) defined in com.views.home.AppView
class AppView @JvmOverloads constructor(mlist: StoreViewMap, context: Context, attrs: AttributeSet? = null, defStyle: Int = 0) :
LinearLayout(context, attrs, defStyle) {
private lateinit var listener: OnFragmentInteractionListener
private var position = 0
private val mainView: View
var mlistener: StoreViewMap = mlist
constructor(context: Context, _listener: OnFragmentInteractionListener, _position: Int) : this(context) {
listener = _listener
position = _position
initFeed()
}
init {
val layoutInflater: LayoutInflater = context.getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater
mainView = layoutInflater.inflate(R.layout.view_home_feed, this)
}
private fun initFeed() {
mainView.homeSwipeLayout.setOnRefreshListener { fetchSlots() }
loadContentSlots(DataCaching(context).getContentSlots())
}
}