I have a few fragments in one activity. In Main Activity I implemented popBackStack();
in onBackPressed();
So that, you can always go back to previous fragment clicking back button. But popBackStack();
doesn't remove the fragment I just left.
How to achieve removing current fragment each time, we click back button?