l8gcqa
Last Updated: February 25, 2016
·
11.27K
· sapandiwakar
3ed0ed63814f37be06e4547362c65f2c

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.

Say Thanks
Respond