I have a problem that I can't seem to find the solution to.

I have an app that loads the `main.xml` file on startup, of course. In it are several buttons, and I want the buttons to take me to a different XML file. I just used `setContentView(R.layout.newlayout.xml)` method for that, and it works great.

The problem comes in after that. If I reference any of the buttons or other objects in the new layout, the app won't even finish loading before it errors out and closes on the emulator. **However, if I take all references to objects out, the app runs fine.**

I can navigate *TO* the new layouts, but their buttons can't do anything. Do I need to create a separate Java file for each layout? Or am I doing it all wrong? I'm trying to be as specific as I can. I suppose you could say I need to have different **"pages"** in my app as a website would.