replaceFragment Error
See original GitHub issueHi @YoKeyword
I have a Viewpager include: Fragment A, B, C, D
A is a blank Fragment
-> in A, loadRootFragment(Fragment E)
-> in E, button click to replace(Fragment F, false);
-> viewpager setCurrentItem(1)
-> viewpager setCurrentItem(0)
. Fragment F come back
When Fragment F
come back, both onLazyInitView
and onSupportVisible
are still called in E
How to replace(Fragment F), then Fragment E is removed (onLazyInitView
and onSupportVisible
isn’t called in E)
Issue Analytics
- State:
- Created 6 years ago
- Comments:19 (8 by maintainers)
Top Results From Across the Web
How to fix fragmentTransaction.replace error and cannot be ...
'replace(int, android.app.fragment)' in 'android.app.fragmentTransaction' cannot be applied to. which is also. Error: ContactDetailFragment ...
Read more >AppCompat 25.1.0 FragmentTransaction replace keeps ...
In AppCompat 25.1.0 when I replace a fragment, the previous fragment is still visible behind the new fragment. This code has worked for...
Read more >Fragment transactions - Android Developers
Use replace() to replace an existing fragment in a container with an instance of a new fragment class that you provide. Calling replace()...
Read more >Replace fragment tag with FragmentContainerView Causing ...
Replace fragment tag with FragmentContainerView Causing Runtime Error. Because it fails to find navigation controller in your activity class. You ...
Read more >android.app.FragmentTransaction.replace java code examples
FragmentTransaction tx = fragmentManager.beginTransation(); tx.replace( R.id.fragment, new MyFragment() ).addToBackStack( "tag" ).commit();
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
In FirstDetailFragment:
or in ZhihuFirstFragment:
Thanks for your support!