I have created a activity in which I placed a fragment and inside fragment I have used a card view. when I click on card view it moves to next fragment and set title of card view to next fragment toolbar. The problem is when I press back button previous fragment not showing its name and showing next fragment name. Is there any solution for this problem?
cardLaw.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
replaceFragment(new CategoryDetailFragment());
((MainActivity) getActivity()).getSupportActionBar().setTitle("Law & Order");
}
});
0 Answer(s)