I'm not sure why you're trying to do that, but here's one way...
- Call setContentView once, on a XML file that contains only an empty FrameLayout
- Based on which view you want to show, inflate the view using a LayoutInflater into the FrameLayout. Change the visibility of all sibling Views so they are invisible. Keep track within your Activity of which Views have been inflated.
- If you want to switch to a View that's already been inflated, just change its visibility instead of re-inflating it.
I would recommend that you rethink why you're doing this. I don't know anything about the rest of your design goals, but that sort of thing sounds like it would be easier to do by handling each screen as a separate Activity.