I am currently making app that is using ExpandableListView
with cursors provided by CursorTreeAdapter
. In my DB I have countries and cities of these countries.
Now I want to implement SearchView
thanks to which I will be able to search a specific city. The tricky thing is that when I search I want to display only groups(countries) where relevant city is. I don't want to display empty groups.
For now I have Loader
of countries in my main Activity and from there the resulting data is inserted inside my CursorTreeAdapter
implementation inside which I am loading cities. Currently I only found only this blog with search in ExpandlableListView
, but there isn't implementing any mechanism hiding empty groups.
And that is how my tables look like
Countries table
|ID|Name
City table
|ID|countryID|Name
Does anyone has any idea how it can be achieved?