I have a tab + ViewPager
layout and in one of these tabs I have a list view. When I replace that list fragment upon the onclick I can still see the old fragment u
The fragment's UI is a part of the activity view hierarchy. So if you created your views in onCreateView() method then you inflate your layout using the ViewGroup container. This container keeps references to your fragment views. Try to override onDestroyView() method of your fragment and remove all the views from the parent:
@Override
public void onDestroyView() {
//mContainer.removeAllViews();
ViewGroup mContainer = (ViewGroup) getActivity().findViewById(R.id.container);
mContainer.removeAllViews();
super.onDestroyView();
}