Trying to replace current Fragment to another one by capturing its root view id as container id programatically but getting Null value exception.
Fragment fragment = MyNewFragment.newInstance(name);
getActivity().getSupportFragmentManager().beginTransaction()
.replace(this.getView().getRootView().getId(), fragment, fragment.getClass().getSimpleName()).addToBackStack(null).commit();