Incorrect display after replacing fragment
See original GitHub issueHello, There is a display error when the fabOptions is rebuilt into a new fragment, let me explain :
- Everything is fine when it is in the first display of the fragment.
- But there is a problem displaying the icons when I replace by the same fragment :
DetailsBuddyFragment details = new DetailsBuddyFragment(); getSupportFragmentManager().beginTransaction().replace(R.id.fragment_details_buddy, details, TAG_DETAILS_FRAGMENT).commit();
The icons are here but hidden. (We see a small clickable part on the right) I tested for an API 19 and by xml and programmatically.
When I do both at the same time :
- First add fragment
- After replace
Can you solve the problem ? Thx
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Wrong replaced fragment view after screen orietation change
1 Answer 1 ... One solution is to keep the current tag or fragment as a static variable. Otherwise, do you want to...
Read more >onStart on new Fragment is called before onStop on previous ...
When changing fragments (support.v4 ones) the lifecycle is incorrect. Sample project has two fragments: FragmentA and FragmentB.
Read more >Fragment - Android Developers
FragmentStrictMode added a new WrongNestedHierarchyViolation that detects when a child fragment is nested within it's parent's View hierarchy, but not added ...
Read more >Creating and Using Fragments | CodePath Android Cliffnotes
onActivityCreated() is called when host activity has completed its onCreate() method. onStart() is called once the fragment is ready to be displayed on...
Read more >Android Fragments Common Queries & Common Mistakes
When to use FragmentTransaction add vs replace ? ... In our Activity we have a container and inside this container we display our...
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 Free
Top 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
So I have completely change my code and I no longer use your library. 😕 I think the bug comes from CoordinatorLayout and CollapsingToolbarLayout behind the fragment who contains FabOptions view but I’m not sure. You can close the issue if you want, but I may add some functionality to your library later. Have a nice day
I know maybe it’s too little too late, but you could’ve reset your buttons when the
Activity
is recreated, I’m thinking about doing another release and I’ll probably expose #35 theopen()
andclose()
methods, that might help to better handle the view.