Giter VIP home page Giter VIP logo

Comments (10)

konmik avatar konmik commented on August 21, 2024

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.

cavarzan avatar cavarzan commented on August 21, 2024

@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.

konmik avatar konmik commented on August 21, 2024

I typically get such kind of errors when my View's onSave/onRestore is not properly overloaded.

from nucleus.

cavarzan avatar cavarzan commented on August 21, 2024

@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.

konmik avatar konmik commented on August 21, 2024

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.

cavarzan avatar cavarzan commented on August 21, 2024

@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.

cavarzan avatar cavarzan commented on August 21, 2024

Or onCreate is called once and I need to check the state in onTakeView ?

from nucleus.

konmik avatar konmik commented on August 21, 2024

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.

cavarzan avatar cavarzan commented on August 21, 2024

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.

konmik avatar konmik commented on August 21, 2024

The best place for dependencies injection is PresenterPactory, see Ryan's and my answers in #12 (comment)

from nucleus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.