In the 'onLoadChildren' method of the MediaBrowserService we must return a list of MediaItems in order for the client to build it's UI accordingly. How would I go about it if in my service I have a cursor I just fetched from the MediaStore, or an instance of LiveData I just got from say a room DB?
I can't understand how to convert my cursor/live data into a list of media items (without iterating all the cursor/LiveData data of course), or how will the client know when it needs to fetch some more data from the service?
Thank you
So I finally found a solution to my problem. I used the Android new Paging library in order to request pages of MediaItems from my service. This way I don't iterate through all my cursor's records, and just fetch the MediaItems the user wants to see.
I wrote a blog post about it where I go into details and provide code samples demonstrating the solution.