Android Button Onclick
<p>OK i'm new to android dev's and java so im having problems with on click method heres my code i know ive gotta be close thanks in advance all i want my button to do is when its clicked on the phone to swith the layout view from main.xml to xx.xml</p>

<pre><code>  package my.project;

import android.app.Activity;

import android.os.Bundle;

 import android.view.View;
 import android.view.View.OnClickListener;
import android.widget.Button;

   public class ExperiencerlActivity extends Activity {
   /** Called when the activ`enter code here`ity is first created. */
  @Override
 public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);      
    Button button = (Button) findViewById(R.id.button1);
    button.setOnClickListener(new OnClickListener() {

        public void onClick(View v) {
            // TODO Auto-generated method stub

        }
    });
}



}


  Here is my button code

     &lt;Button
    android:id="@+id/button1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_above="@+id/linearLayout1"
    android:layout_centerHorizontal="true"
    android:layout_marginBottom="56dp"
    android:onClick="setLogin"
    android:text="Login" /&gt;
</code></pre>
