If the newFragment is visible over the oldFragment then you are not replacing the correct View. Try using ParentFragmentManager instead of ChildFragmentManager:
parentFragmentManager.beginTranaction.replace(container!!.id,newFragment).commit()}