Separate Back Navigation for a Tabbed View Pager in Android

前端 未结 3 1074
傲寒
傲寒 2021-02-09 02:48

What I want.

In a tab sliding menu context, I want to replace a fragment to another inside a tab, and maintaining the tab menu, and also the current tab

3条回答
  •  旧时难觅i
    2021-02-09 03:40

    You can change fragments inside page fragment. For example, TAB_A implements logic of picking fragment 1 or 2, and displaying picked fragment inside. Hierarchy looks like:

    ViewPager -> TAB_A -> fragment 1 or 2 (displaying inside TAB_A).

    Also you should use getChildFragmentManager() to manage fragments inside TAB_A.

提交回复
热议问题