• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

How to remove SharedPreference after on itemclick in recycler view with kotlin

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 :

How can i make my code functionnal?

 
Ranch Foreman
Posts: 313
4
Android Tomcat Server Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It a little bit hard to understand what you trying to achieve.
 
Maha Sakka
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
 
Maha Sakka
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you please help me
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!