I have a Recycler View. Actually what I need is when I click any item in Recycler View that Item must get color and when I click another item I want that the first one become normal from an Activity
Asked
Active
Viewed 35 times
0
-
And what code have you written for that? There is no one who can help you without some useful code. Please see [How to ask](https://stackoverflow.com/help/how-to-ask) – gtxtreme Oct 14 '21 at 05:27
-
2Does this answer your question? [Changing background color of selected item in recyclerview](https://stackoverflow.com/questions/40692214/changing-background-color-of-selected-item-in-recyclerview) – Nitish Oct 14 '21 at 05:27
-
No this link not useful – Muhammad Sajid Oct 14 '21 at 06:47
-
@gtxtreme Actually i have recycler adapter and i want to update item background color from MainActivity.kt – Muhammad Sajid Oct 14 '21 at 06:48
-
You need to add a "isSelected = true/false" state for your item in adapter. When it's selected change color. – bogdanN Oct 14 '21 at 07:57