Win a copy of Pro Spring MVC with WebFlux: Web Development in Spring Framework 5 and Spring Boot 2 this week in the Spring forum!
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

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

 
Ranch Hand
Posts: 179
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?

 
Rancher
Posts: 589
9
Android Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It a little bit hard to understand what you trying to achieve.
 
Maha Sakka
Ranch Hand
Posts: 179
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 179
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Could you please help me
 
reply
    Bookmark Topic Watch Topic
  • New Topic