Replacing one fragment with another in Android dynamically
I needed to replace fragment in an Android application when I was using Tab bar and I needed to change fragment when tab bar is changed. At first, I defined the fragment statically in layout file and when I tried to change it dynamically I received an error. Then I found out that it is only possible to change those fragments defined dynamically via a FragmentTransaction. Replacing one fragment with another in Android dynamically describes how to replace fragments in Android programatically.
Written by Sapan Diwakar
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Android
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#