I want ask you about some not standard navigation pattern in android. So, my problem described below. If you do not have answer or some details do not understand, do not minus please. Just write comment and I correct my stuff. I do not use ViewPager or TabHost. Please see image to understand my expected navigation model:
So, we have activity with 3 tabs. All tabs must be contain stack of fragments. First tab has only one fragment, so there no backstack logic. But another two tabs must have fragments logic with back way. Also user can switch all tab in any time.
To implement tabs I'm used BottomBar library.
I tried implement my solution with Stack[] array. And change fragments manually. But I receive memory leak. After many manipulation I understand here no way to find solution. So, I want ask, how I can implement solution with Android native backStack. Or any another solution.. Waiting for your answer. Thanks.
You can add Fragments to back stack using below code.
When you add second fragment use the below repleaceFragentMethod.
To find Memory Leaks Use LeakCanary(https://github.com/square/leakcanary)