I have a Fragment
in which I display a response which is the details of a user, and that response contains information about other users(same json structure) and clicking on that link I inflate the same fragment(with different instance) which displays the information and this goes on and on everything is fine till here. Now when I press back key from last instance the previous fragment is not displayed and the last fragment with nth user data keeps on displaying.
Eg. Fragment A->(click on B profile)->Fragment A with B Profile->(click on C profile)Fragment A with C profile
when I backpress all I get is
Fragment A with C profile->Fragment A with C profile-> app closes.
and I'm adding the fragment to backstack with the following code.
ft.add(R.id.home_container_fl, baseFragment).addToBackStack(Fragment.class.getSimpleName()).commit();
I'm also using event bus for the same does that can affect this behaviour?
How can I fix the same?