This repository has been archived by the owner on Mar 16, 2021. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Given: : 🌮
Our sample is broken.
It through a
IllegalStateException: view subscriptions can't be handled when there is no view
.This cames from
RxTiPresenterSubscriptionHandler.manageViewSubscription
which is called from theHelloWorldPresenter#onAttachView(view)
But: Why it says that there isn't any view, when onAttachView is called? 🤔
Reson: ❌
After a quick reseach the reason is simple:
We introduced such a exception with #58 .
So this is working like expected.
But: Why is is thrown on
onAttachView
?Because of the
TiLifecycleObserver
. The documentation says:beforeLifecycleEvent
is wrong here.If we take a look into the implementation in
TiPresenter#attachView
we see the following:The second parameter here indicates if the
on*
method is already called.Which is wrong according to the documentation of the
TiLifecycleObserver
.The fix: 💚
Because we have already implementations with the
TiLifecycleObserver
I've just changed the documentation (and a better boolean name 😉)I've also fixed the implementation of the
RxTiPresenter*Handler
.. which have thrown the exception...