I create an android app with Kotlin.The description of the app as the following: a recyclerview horizontal which contains all the list of categories, i use adapter. Then, when i click in item in this list, the list of products belongs appear in the bottom in a recyclerview. The disposition of the product list is done in two ways : either list or grid. the following code is the activity :
My problem is when i click on category, the list of products belong appear, then, when i click on another category, the list of product of the last item appear not the list of product of the category clicked. I think to remove the sharedpreference and still not working. the following code is for sharedpreferences :
Randy Tong wrote:It a little bit hard to understand what you trying to achieve.
when i choose one category and click on, the list of product belongs appear that's what i want to do.
But, in my case, when i click on the category,the list of product of before last category clicked appear not the last one