Can't access view in holder
Solution 1:
If you're using kotlin extensions and have a text view with an id mTextView, then it should be:
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
holder.itemView.mTextView.text = "1 + 1 = 3" // Should work?
}
You can also define variables in your ViewHolder and use them directly, this is the best way in terms of performance as it won't force unecessary calls to findviewbyid:
class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
val myTextView = itemView.mTextView
}
And later access it like:
holder.myTextView.text = "some text"