Comments (8)
Are you removing the Fragment via getFragmentManager().beginTransaction().remove(fragment).commit()
?
from transfuse.
Mostly by .replace(R.id.container, newFragment)
, but it's the same thing, I think.
from transfuse.
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.
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.
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.
Good deal. I do appreciate the post even if it is a false alarm. Keep the input coming!
from transfuse.
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.
As you see it fit :)
from transfuse.
Related Issues (20)
- `Parcelable` not allowed as `@Extra`? HOT 14
- @Extra injection in fragments HOT 2
- Feature request: inject extras from intent into BroadcastReceiver HOT 5
- base class with @UIThread annotations seem to be ignored HOT 5
- exception with box types as Extras
- Using a factory defined in a library HOT 4
- some generation problems after updating to latest support library HOT 14
- Activity/Fragment lifecycle calls to super not enforced HOT 14
- hardwareAccelerated attribute doesn't seem to be included in AndroidManifest.xml HOT 1
- problem building with android-apt:1.6 HOT 7
- Fragment factories should extend common base class
- Fix custom scopes
- Finalize Plugin API
- null @Parcel @Extra throws exception HOT 7
- Provides methods with same return types ignore qualifiers
- parentActivity in @Activity
- Kotlin support HOT 1
- Android API 28+ (OREO and Above)
- Using JavaFileObject.openOutputStream is very slow
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 transfuse.