I am trying to make a simple list fragment by using paging library. The document said if I want to refresh the entire list, I should use invalidate method in DataSource. When I call this method, a new DataSource will be created and method loadInitial will be called, but if I encounter an error in loadInitial, for example, I load remote data from network, it's very common to meet an network error, then I need to call loadInitial again when I need to retry. But after I calling invalidate, the all my old data in the list are cleared because paging library give me a new empty PagedList. Even if I wait until the new list is not empty, the old list can not load next page because it have bean already invalided.
What should I do if I want to keep my old list working when invalidate the DataSource but encounter an error?