AutoClearedValue cleans reference on Destroy of other fragment
See original GitHub issueonFragmentViewDestroyed
is being called even if the Fragment that is being destroyed is not the Holding Fragment. For Example - From the Base Fragment, open a DialogFragment
DialogFragment fragment = new SomeFragment();
fragment.show(getFragmentManager(), "tag");
On coming back from the Dialog Fragment, All AutoClearedView
instances will get cleared in the Base Fragment. add same instance check on the Fragment solves the issue
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
AutoClearedValue cleans reference on Destroy of ... - GitHub
For Example - From the Base Fragment, open a DialogFragment ... AutoClearedValue cleans reference on Destroy of other fragment #56.
Read more >Let your delegates auto-nullify references☠️ | by Shreyas Patil
Fragments outlive their views. Make sure you clean up any references to the binding class instance in the fragment's onDestroyView() method. In ...
Read more >Let your delegates auto-nullify references☠️ - Shreyas Patil
Fragments outlive their views. Make sure you clean up any references to the binding class instance in the fragment's onDestroyView() method.
Read more >AutoClearedValue accessed from another thread after View is ...
I am using AutoClearedValue class from this link and when view is destroyed, backing field becomes null and that is good but i...
Read more >architecture-components-samples/AutoClearedValue.kt at main
* A lazy property that gets cleaned up when the fragment's view is destroyed. *. * Accessing this variable while the fragment's view...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@yigit Because of your test missing dismiss before assert testFragment.testValue.get() with “foo” Test should be:
Can we fix this bug with check the fragment that is destroyed view is the fragment registerFragmentLifecycleCallbacks?
you are right, sorry about that.
I’ve updated the PR and also reported here: https://issuetracker.google.com/issues/63514149