I'm trying to change the layout of a fragment during runtime under a particular condition.

The initial layout in inflated within the onCreateView():

```
@Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        return inflater.inflate(R.layout.cancel_video, null);
    }

```

Then sometime later within the fragment code I would like to replace the initial layout with some other layout.

I've tried a few things so far; this is the latest that I have:

```
private void Something(){
    if(checkLicenseStatus(licenseStatus, statusMessage)){
                View vv = View.inflate(getActivity(), R.layout.play_video, null);
                //more code
    }
}

```

How can I accomplish this?