Answer the question
In order to leave comments, you need to log in
Filtering a custom ListView?
I have a ListView with a custom adapter from ArrayAdapter, where each element is an object with several properties. The data in the ListView is loaded from the network periodically at a specified interval. It is necessary to implement an enable/disable filter by two numeric values inside the object.
To implement this, I created my own filter inside the adapter. But this approach does not work quite the way we would like. Firstly, apparently it changes the contents of the adapter, and secondly, it does not take into account freshly added data. And I would like to have a filter that simply hides the rows that do not match the condition when turned on, without affecting the true contents of the ListView in any way. However, I have not been able to find methods to hide individual rows. Are there built-in tools to implement this? If not, what is the best way to implement it?
Answer the question
In order to leave comments, you need to log in
1. No need to put into the adapter what should not be shown.
2. Even if you put it in, the filter should help, so deal with the filter, maybe something is wrong in the code.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question