The current app that I’m creating is using gson to parse and populate a listview via a remotely hosted json file. I have an options menu inside my app that I would like to use that will allow users to select/deselect items so that they will either show (if selected) or not show (if deselected) inside the listview that is shown on screen via the remote json file.
My question is, how do I go about implementing this function? Can I simply use a shared preferences? Is it even possible to hide certain list items while using a json file?
I’ve been having a lot of trouble trying to figure this out so any and all help will be greatly appreciated.
Using a custom ArrayAdapter you could “choose” what is displayed according to some prefs (I would do the filtering on the list of objects you pass to the constructor).
Something like that:
This assumes that the preference “some_key” contains a comma separated list of
dbId(like1,5,12,)NB not tested