I think when you create a new xml, the controls on it get an id and that is automatically added to the resource file (R), so you can talk to the button (so to speak) from anywhere in the code as far as I know... when you are using your button1 code on the first layout, are you referencing it using findViewById(R.something_here) ?
Like
Button myButton = (Button)findViewById(R.id.Button01); for example?
My code may be a bit wrong im afraid , but if your button was called 'Button645' and on a different xml layout, I think you can still use it in the same way, so change 01 to 645 and it should pick it up.
As I say, I could be wrong, i've only been looking at it for a week!
P.S, I experimented with this stuff in the main onCreate class.