Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Listview listening to hashmap  RSS feed

 
simone giusti
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Suppose you populated an hashmap.
Is these a way to update a listview once a value changes?
How to create a listener automatically reflecting key/value in hashmap?
 
Norm Radder
Ranch Foreman
Posts: 2240
28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One way might be to wrap the hashmap with your own class and have it handle listeners.
 
Campbell Ritchie
Marshal
Posts: 55717
163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Observer and Observable?
Find out about the observer pattern; that will probably help you.
 
simone giusti
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:Observer and Observable?
Find out about the observer pattern; that will probably help you.


any code hints ??
 
Campbell Ritchie
Marshal
Posts: 55717
163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have a look at this link, which I found by searching our FAQs/Wiki forum. I hope that will help you.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!