I have an activity that contains navigation buttons in separate fragment and FrameLayout. FrameLayout contains content fragment that represents one of apps categories(Timeline, Profile, etc.). Clicking to navigations buttons allows to switch between content fragments(categories). Categories also have sub categories.
The question is how to make proper back navigation with separate back stack for each category, to switch between categories with last state(sub category fragment) remembering (to continue use from last state) also for each category. How to realize it?
Thanks for all. There are a lot of answers here (ZERO). It is "so complicated" question dudes!
I figured out that it is possible to realize this functionality using Fragment.getChildFragmentManager with frameLayout inside Category fragment. Switching between categories using category fragments; Making separate back stack with .getChildFragmentManager and frameLayout inside category fragments with sub category fragments. Also you can user ViewPager as a switching tool.