I have to following code for selecting layout on button click.
View.OnClickListener handler = new View.OnClickListener(){ public void onClick(View v) {
I would add an android:onClick to the layout and then change the layout in the activity.
android:onClick
So in the layout
Then in the activity add the following:
public void changelayout(View view){ setContentView(R.layout.second_layout); }