Comments (10)
Hello,
No, I'm not aware of such issue. I have a test that ensures that such issue does not exist and RxPresenter works well on production. Do you have an example that can reproduce this behavior?
from nucleus.
@konmik I'll test again tomorrow and follow up you with more info. Basically is a RxPresenter that has a Dagger2 module injected after onTakeView
. I will take a better look to provide more useful informations about this.
Thanks!
from nucleus.
I typically get such kind of errors when my View's onSave/onRestore is not properly overloaded.
from nucleus.
@konmik what did you mean with this?
I've checked now and seems that presenter state comes to my fragment, but the presenter doesn't receive that bundle.
I create a gist with the sample of code here:
https://gist.github.com/cavarzan/597b6c618b1f9f339f0d
from nucleus.
I never used ViewPager
, but if a fragment gets its bundle, then the presenter should also get its bundle.
Here is an example of NucleusFragment
usage: (https://github.com/konmik/nucleus/tree/master/nucleus-example-with-fragments)
What your BasePresenterFragment
does? Does it override onCreate
/onSaveInstanceState
? This is how I usually get my errors of such kind - by improperly overriding these methods. :)
from nucleus.
@konmik The BasePresenterFragment
doesn't override those methods.
I've fixed a error in ViewPager
that was recreating all fragments. I think it solved.
The thing now is onCreate(Bundle savedState)
in Presenter
is not called after orientation changes.
I double check your example but I can't see anything that I'm missing =(
from nucleus.
Or onCreate
is called once and I need to check the state in onTakeView
?
from nucleus.
onCreate
is called once. This is why we use MVP. :) Another time we have it run is only in the case of process restart.
You normally do not need to override onTakeView()
- register restartables during onCreate
and call them when needed.
from nucleus.
Nice! I think this issue can be closed now. Thanks a lot for your patience.
I using onTakeView()
now for inject dagger dependencies, since I need the view to call getComponent
and inject the presenter.
from nucleus.
The best place for dependencies injection is PresenterPactory
, see Ryan's and my answers in #12 (comment)
from nucleus.
Related Issues (20)
- Best practice for normal case. (get support.) HOT 3
- Wondering about multiple Presenter endpoint calls (Question) HOT 2
- How to get onComplete using restartable methods? HOT 1
- How could i force restartableFirst.onError with mockito? HOT 1
- RxJava latest version not used. HOT 1
- Console error saving file HOT 1
- Activity method called every time HOT 2
- (Question) Don't keep activieties option HOT 1
- Confusion about restartables and the Activity lifecycle HOT 3
- Does Nucleus support native Fragments? HOT 2
- Throwing VerifyError in < API 21 HOT 1
- Question regarding getView() and reference the View in the presenter. HOT 11
- Nucleus with Dagger 2 HOT 3
- NucleusActionBarActivity with support library 26 HOT 13
- Help with injecting Presenter when using AndroidInjector HOT 3
- Calling setPresenter in OnCreate HOT 2
- clear the delivery cache
- Crashes when starting a new activity using kotlin
- upgrade a new version for androidx, please
- getView() deprecated
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nucleus.