fragment-tab-host

Dynamically changing the fragments inside a fragment tab host?

让人想犯罪 __ 提交于 2019-11-26 00:54:47
问题 I have one main activity which is fragment activity here I am setting two tabs with two fragments A and B in the B fragment I have one button when the user click on the button I want to change fragment B to fragment C. But the tabs above are visible... How I can achieve replacing fragments inside tabs? Any solution are greatly appreciated. 回答1: Basic concept- We can achieve this by creating a container. Each tab will be assigned with a specific container. Now when we need a new fragment then

Dynamically changing the fragments inside a fragment tab host?

不羁岁月 提交于 2019-11-25 19:20:38
I have one main activity which is fragment activity here I am setting two tabs with two fragments A and B in the B fragment I have one button when the user click on the button I want to change fragment B to fragment C. But the tabs above are visible... How I can achieve replacing fragments inside tabs? Any solution are greatly appreciated. AndroidHacker Basic concept- We can achieve this by creating a container. Each tab will be assigned with a specific container. Now when we need a new fragment then we will replace same using this container. Kindly follow undermentioned code step by step to