GithubHelp home page GithubHelp logo

Comments (8)

johncarl81 avatar johncarl81 commented on June 16, 2024

Are you removing the Fragment via getFragmentManager().beginTransaction().remove(fragment).commit() ?

from transfuse.

goodsoft avatar goodsoft commented on June 16, 2024

Mostly by .replace(R.id.container, newFragment), but it's the same thing, I think.

from transfuse.

johncarl81 avatar johncarl81 commented on June 16, 2024

Hmm, the Fragment should be going through the "reverse series of callbacks" when it is "no longer used": http://developer.android.com/reference/android/app/Fragment.html#Lifecycle which includes onPause()

I'll have to investigate this a bit more to see what and if we should change. We should register and unregister in one specific, guaranteed callback respectively.

BTW, looking at Otto's example, it seems they also unregister in the onPause() method as well:
https://github.com/square/otto/tree/master/otto-sample/src/main/java/com/squareup/otto/sample

from transfuse.

goodsoft avatar goodsoft commented on June 16, 2024

I have looked at this once again and the problem apparently was with the fact that I was removing parent fragment without removing fragments embedded into it. So onPause was called for parent fragment, but wasn't called for child fragments.
Anyway, the problem is outside of Transfuse scope, so closing the issue.
Sorry for disturbance.

from transfuse.

goodsoft avatar goodsoft commented on June 16, 2024

Okay, the issue was that I was using injected FragmentManager in the parent fragment, which is injected via call to getFragmentManager().
If I instead use getChildFragmentManager() for adding/removing child fragments, they are automatically removed with parent fragment and the issue is solved.
Maybe add some way of injecting getChildFragmentManager into fragments?

from transfuse.

johncarl81 avatar johncarl81 commented on June 16, 2024

Good deal. I do appreciate the post even if it is a false alarm. Keep the input coming!

from transfuse.

johncarl81 avatar johncarl81 commented on June 16, 2024

Absolutely. We would just need to add it to the FragmentPlugin. How would you like to inject it? We could specify a qualifier annotation for this injection since htere are many different types of FragmentManagers:
@ChildFragmentManager FragmentManager manager;

from transfuse.

goodsoft avatar goodsoft commented on June 16, 2024

As you see it fit :)

from transfuse.

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.