ViewStub stub = (ViewStub) findViewById(R.id.layout_stub); stub.setLayoutResource(R.layout.whatever_layout_you_want); View inflated = stub.inflate();