• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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: 665
10
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
 
We can walk to school together. And we can both read this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic