I have got nexus player and would like to add new row in search with my own suggesstions. I'm downloading theme from website (more than 1 million items), so I'm doing everything from here:
https://developer.android.com/training/tv/discovery/searchable.html
In content provider's query I'm filling the cursor elements that every time I'm downloading from website. But this solution is too slow, android is waiting only a few seconds for the whole filling cursor (fetching every elements is depends on the state of internet connection).
Because of that I've thought about paginated cursor like from here: https://github.com/googlesamples/androidtv-Leanback
where the searchable is implemented.
I've added the log to overriden AbstractCursor.onMove() method and it looks like this solution is waiting for every elements from cursor too. I've seen, that the suggesions are shown in the row only after android moves through all of elements in the cursor.
I would like to have the real pagination in my search, where every elements are added to the row only when they are needed (like we can see in the row with YouTube suggestions).
Is it possible in this android API? Can I return in contentProvider.query() cursor with a small amount of items and fill it only when I scroll to the end of the row with suggestions?
Asked
Active
Viewed 703 times
0

Vadim Kotov
- 8,084
- 8
- 48
- 62

jan_kowalski_314
- 84
- 7
-
maybe it's not a direct answer but what is user supposed to do with a search result having 1mln records? like klik 1000 times to get to 1000th page? what i want to say here is, don't focus on pagination but on how not to have such a big search result! – pelotasplus Aug 06 '15 at 09:36
-
I understand that, but even downloading 1000 elements in a few seconds can be problematic. I would like to show firstly e.g. 10 items and then download next 10 elements and add them to the row with suggestions etc. – jan_kowalski_314 Aug 06 '15 at 15:45
-
For me that was clear that when I return the cursor in ContentProvider.query() I can extend it later calling on this cursor addRow() What's the problem with that? What's happening with returned cursor? – jan_kowalski_314 Aug 06 '15 at 16:13
-
Did you find a good solution for this? – Micky Mar 07 '16 at 08:25