# Kotlin recyclerview

**URL:** <https://forums.kodeco.com/t/kotlin-recyclerview/73047>\
**Category:** Android\
**Created:** [June 5, 2019, 7:38pm UTC](https://forums.kodeco.com/t/kotlin-recyclerview/73047 "2019-06-05T19:38:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tommynocker](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/tommynocker/32/81494_2.png) [@tommynocker](https://forums.kodeco.com/u/tommynocker)\
**Post date:** [June 5, 2019, 7:38pm UTC](https://forums.kodeco.com/t/kotlin-recyclerview/73047/1 "2019-06-05T19:38:08Z")

</div>

Hi,

i follow some tutorials here.  
But what i missing is the hint, how can i properly highlight a selected item on RecyclerView?  
I handle the cllick event, but how can i set or change for example the background color

here is my snippet for the viewholder:

inner class ViewHolder(val binding: NewArticleCategoryItemRowBinding) : RecyclerView.ViewHolder(binding.root),  
View.OnClickListener {

```
    init {
        binding.root.setOnClickListener(this)
    }

    fun bind(item: ArticleCategory) {
        binding.viewmodel = NewArticleCategoryItemViewModel(item)
        binding.executePendingBindings()
    }

    /**
     * List click
     */
    override fun onClick(view: View) {
        selectedCategoryItem = items[position]

    }

}

```

Thanks for any help or hints

---

<div class="post-metadata">

**Author:** ![shogunkaramazov](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/shogunkaramazov/32/108826_2.png) [@shogunkaramazov](https://forums.kodeco.com/u/shogunkaramazov)\
**Post date:** [July 9, 2019, 7:08pm UTC](https://forums.kodeco.com/t/kotlin-recyclerview/73047/2 "2019-07-09T19:08:48Z")

</div>

@tommynocker Do you still have issues with this?

---

<div class="post-metadata">

**Author:** ![tommynocker](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/tommynocker/32/81494_2.png) [@tommynocker](https://forums.kodeco.com/u/tommynocker)\
**Post date:** [July 11, 2019, 5:08am UTC](https://forums.kodeco.com/t/kotlin-recyclerview/73047/3 "2019-07-11T05:08:23Z")

</div>

Yes, can you give me a hint?

---

<div class="post-metadata">

**Author:** ![system](https://s3.amazonaws.com/cdn.raywenderlich.com/community/forum-assets/noun-game-ghost-878668.png) [@system](https://forums.kodeco.com/u/system)\
**Post date:** [November 19, 2019, 11:38am UTC](https://forums.kodeco.com/t/kotlin-recyclerview/73047/4 "2019-11-19T11:38:12Z")

</div>

This topic was automatically closed after 166 days. New replies are no longer allowed.
