I have resolved my problem by declaring rootview at class level and overriding below method.
@Override
public void onDestroyView() {
super.onDestroyView();
if (rootView != null) {
ViewGroup parentViewGroup = (ViewGroup) rootView.getParent();
if (parentViewGroup != null) {
parentViewGroup.removeAllViews();
}
}
}