I’ve got a custom View that I define at runtime. I don’t want it to fill the screen, I want it to be inside a larger layout that’s defined in XML.
This is what I’d like to do in pseudo code:
View newView = new MyCustomView();
View.replace(newView , R.id.old_view);
Any ideas?
Thanks
I suggested using a ViewStub in the comments above, but I think that might be overkill. You could just try this:
It’s just getting reference to the top level layout, adding the new component and removing the old one. I think it should do the trick.
Casp