This repository has been archived by the owner on Mar 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 101
How to free presenter manually / Nested fragments/presenter don't get destroyed #101
Labels
Comments
I found the way to solve it, but it is ugly. Now, presenters of nested fragments will free immediately. Better solutions are welcome @Override public void onPause() {
super.onPause();
if (isRemoving() && !isFragmentInBackstack()) {
if (nestedFragment != null) { getChildFragmentManager().beginTransaction().remove(nestedFragment).commitNowAllowingStateLoss();
}
}
} |
Can you explain what is causing the memory leak or churn? Are you saying multiple C presenters are being created? Is the B destroyed at the right time but not the C presenter? |
B presenter is destroyed, but C presenter remains in memory. Because check |
StefMa
changed the title
How to free presenter manually?
How to free presenter manually / Issue with nested fragments
Sep 29, 2017
StefMa
changed the title
How to free presenter manually / Issue with nested fragments
How to free presenter manually / Nested fragments don't get destroyed
Sep 29, 2017
StefMa
changed the title
How to free presenter manually / Nested fragments don't get destroyed
How to free presenter manually / Nested fragments/presenter don't get destroyed
Sep 29, 2017
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I have a situation when user switch fragments
It happens many times and creates serious memory footprint. After 20 times or so the app may even freeze.
Basically when there is a check in
onDestroy()
isFragmentInBackstack() = false
, butisFragmentRemoving() = false
in nested fragment and nothing get clearedHow to free presenter manually in such case?
The text was updated successfully, but these errors were encountered: