Answer the question
In order to leave comments, you need to log in
DataBinding not working in RecyclerViewAdapter(Android, Kotlin)?
Here is the code for the OnBindViewHolder function:
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
val country = countries[position]
var countryInfoCardBinding = DataBindingUtil.setContentView<CountryInfoCardBinding>(context as Activity, R.layout.country_info_card)
countryInfoCardBinding.country = country
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question