i have app like this
one activity and inside it >
- fragment a (loaded when run app also from menu can open it )
- fragment b (open it from just menu)
- fragment c (can open it from fragment a and also can open it from menu)
also inside fragment c there are 4 child fragments
in main activity(using navigation drawer as source) i call fragment a in oncreate like this
FragmentManager fragmentManager=getSupportFragmentManager();
fragmentManager.beginTransaction().replace(R.id.fragment_place,new First_Fragment()).addToBackStack("First").commit();
my problem is how to control back button to always back to fragment a and when fragment a is open close app i was using addToBackStack(null) but is not what i want because will show all history of fragments that i opened