Android: Can someone help me understand how switching between multiple views and layouts within one activity works?
<p>I'm trying to learn how to write apps for the Android by writing a simple game. I have game development experience from the past but I'm finding it difficult to apply my past experience to the Android. </p>

<p>I'm having the most trouble trying to figure out how to draw the different scenes from the game, as pretty much every tutorial I've found has only one scene in the game. I'd like to be able to go, for example, from the main menu to the game and then back to the main menu. I'm able to go from the menu to the game by calling setContentView on the menu (which is a layout that I 'set' using setContentView(R.layout.nameOfTheLayout)) and then setContentView on the game's view (which is a SurfaceView) when the start button is pressed. However, when I call setContentView(R.layout.nameOfTheLayout) again, nothing seems to happen. I'm guessing that I'm not properly using setContentView, but the problem is I have no idea what setContentView is actually doing... it's a big black box for me and I haven't been able to find an explanation for what it's actually doing. I've tried other approaches but nothing really seems to work.</p>

<p>I'm aware that this sounds like a bit of a common question here but I've been hunting online to try to understand this issue for several hours and I can't seem to find anything that clears my doubts. I'm mostly confused about how Android handles Views in general... could any of you hopefully shed some light on how the Activity actually chooses what to render, and how I should be telling it to render something differently? If possible, it would be nice to get some advice on how I can tackle the issue described in the previous paragraph; I keep reading that this type of thing should be done with multiple activities but it's not clear to me how to set up the problem with multiple Activities.</p>
