I have the following layout.
I know it's a bit of an old question but the trick in there is to set the inflatedId parameter to the same as the actual viewStub itself, like this:
inflatedId