Android Paging library 2 onResult forces fragment to be destroyed

31 views Asked by At

I have populated my PagedList from a datasource and I can see all the data as expected. However, when I kill switch to another fragment and launch a new instance of the same fragment, I see the data being returned from the backend but I the fragment is destroyed before I am able to load the data. I was able to debug into the illegalStateException that was thrown when result was returned as follows,

java.lang.IllegalStateException: callback.onResult already called, cannot call again.

Can someone direct me how to properly cleanup after the library when I close the fragment the first time around?

My issue is very similar to this question except my app is not crashing but the fragment is destroyed.

0

There are 0 answers