Problems while testing ListView with a custom FilterQueryProvider
I'm writing a 'functional' test for an activity in my app. I have a `ListView` with a `CursorAdapter`, for which I implemented a custom `FilterQueryProvider` to filter the positions in the adapter and in the list. I wanted to test this provider and hence call `list.setFilterText(...)` and `list.onTextChanged(...)` in an effort to simulate user input. Unfortunately it doesn't work. While debugging I can see that my `FilterQueryProvider` is called and returns a correct cursor. But both `list.getCount()` and `list.getAdapter().getCount()` return and old count of items after that call, even though I could see that the filter provider returned a cursor with correct number of items. It also works OK in the UI (the list is filtered appropriately), it just doesn't seem to be easily testable.
Problems while testing ListView with a custom FilterQueryProvider
===

I'm writing a 'functional' test for an activity in my app. I have a `ListView` with a `CursorAdapter`, for which I implemented a custom `FilterQueryProvider` to filter the positions in the adapter and in the list. I wanted to test this provider and hence call `list.setFilterText(...)` and `list.onTextChanged(...)` in an effort to simulate user input. Unfortunately it doesn't work. While debugging I can see that my `FilterQueryProvider` is called and returns a correct cursor. But both `list.getCount()` and `list.getAdapter().getCount()` return and old count of items after that call, even though I could see that the filter provider returned a cursor with correct number of items. It also works OK in the UI (the list is filtered appropriately), it just doesn't seem to be easily testable.