Conversation
Saving null-value item makes loader's callback trigger onNext with null as argument. So If you just do nothing, but went out of activity, it was killed, you come back and oops, your onNext was triggered just like it had result, but it doesn't. E.g. ```java @OverRide protected void onLoad(Bundle savedInstanceState) { RxLoaderManager loaderManager = RxLoaderManager.get(activityHolder.getActivity()); loginLoader = loaderManager.create((LoginParams params) -> { return sessionManager.login(params); }, new RxLoaderObserver<Session>() { @OverRide public void onNext(Session value) { Flow.get(getView()).replaceTo(new HomeScreen()); } } ).save(); } ```
|
Just to understand the issue correctly. |
|
The problem as I see it is outState bundle is not empty but has a key with null value, so the check for null-ness somewhere inside the lib doesn't work (bundle is not empty, it has key). This is a quick fix, so possibly yes, there is a better way. |
|
Also, it could be RxLoaderBackendFragmentHelper#107 where any (and null) value may pass |
|
Ah, I think I understand why your fix seems to work then. If you have multiple loaders it will fail though, since it saves all items in the same bundle, causing it to be non-empty even if one of them hasn't saved anything. Ideally, the save/restore methods on the callback should not be called at all if |
|
Basically, I moved to |
Saving null-value item makes loader's callback trigger onNext with null as argument. So If you just do nothing, but went out of activity, it was killed, you come back and oops, your onNext was triggered just like it had result, but it doesn't.
E.g.