Do I have to use ?.
and !!.
every time inside onBindViewHolder
and onCreateViewHolder
? Is there any way to avoid this?
holder.textview.text
and parent.context
showing this error.
Code :
override fun onBindViewHolder(holder: ViewHolder?, position: Int) {
holder.textview.text = items[position]
}
override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int):ViewHolder {
return ViewHolder(TextView(parent.context))
}