Fixed
Status Update
Comments
al...@google.com <al...@google.com> #2
Hi Ed, Thank you so much for these suggestions. I've been reviewing them and merging them in. Hopefully it should be live. I've included a thank you note too in the article.
dz...@gmail.com <dz...@gmail.com> #4
Just updated to stable and the problem still persists
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-main
commit 38d0ad0aef7f1561f8587d411007dd885e8c028c
Author: Jeremy Woods <jbwoods@google.com>
Date: Thu Feb 18 17:20:17 2021
Only setFocusedView for entering fragments
We should only the set the focused view for incoming fragments. Any out
going fragments will have their view destroyed so we do not care about
the focused view. Fragments using show/hide, will not change their
lifecycle so any saved focus views would not ever be restored anyway.
RelNote: "Fixed a memory leak in fragments caused by `mFocusedView`"
Test: FragmentFocusTest and in sample
Bug: 179925887
Change-Id: Ib4e9eddfba3ad925471890ff0078d9a65416f7da
M fragment/fragment/src/androidTest/java/androidx/fragment/app/FragmentFocusTest.kt
M fragment/fragment/src/main/java/androidx/fragment/app/SpecialEffectsController.java
https://android-review.googlesource.com/1595207
Branch: androidx-main
commit 38d0ad0aef7f1561f8587d411007dd885e8c028c
Author: Jeremy Woods <jbwoods@google.com>
Date: Thu Feb 18 17:20:17 2021
Only setFocusedView for entering fragments
We should only the set the focused view for incoming fragments. Any out
going fragments will have their view destroyed so we do not care about
the focused view. Fragments using show/hide, will not change their
lifecycle so any saved focus views would not ever be restored anyway.
RelNote: "Fixed a memory leak in fragments caused by `mFocusedView`"
Test: FragmentFocusTest and in sample
Bug: 179925887
Change-Id: Ib4e9eddfba3ad925471890ff0078d9a65416f7da
M fragment/fragment/src/androidTest/java/androidx/fragment/app/FragmentFocusTest.kt
M fragment/fragment/src/main/java/androidx/fragment/app/SpecialEffectsController.java
jb...@google.com <jb...@google.com>
jb...@google.com <jb...@google.com> #6
This has been fixed internally and will be available in the Fragment version 1.3.1
release.
Description
Version used: 1.3.0-beta01
Devices/Android versions reproduced on:
OnePlus 8 (API30), OnePlus 2 (API23), Emulator (API30)
Repository:
Steps to reproduce: Select input field -> Click button to navigate to new fragment (via Navigation library) -> Check notification for LeakCanary message (After returning back via back button all objects are garbage collected, but if you close app via home button you will receive warning from LeakCanary).
Additional info: It seems like there is no such problem in alpha02 version