I am not recommending onResume()/onPause() model at all, in fact if you read the post, I am stating…
Viraj Tank
2
There are 2 distinct problems here:
- the lifetime of view (and as such, when it should reload)
- the lifetime of the “actions” being observed
Following your reasoning, even onViewCreated/onDestroyView is not good enough because you might temporarily detach/reattach that Fragment and have to make a new network call. The observable you’re observing should be “hot” so that subscribing/unsubscribing shouldn’t have any side effect on the underlying action in progress. You can check out this article as a reference for a possible implementation.