//create a variable that contain your button
Button button = (Button) findViewById(R.id.button);
button.setOnClickListener(new OnClickListener(){
@Override
//On click function
public void onClick(View view) {
//Create the intent to start another activity
Intent intent = new Intent(view.getContext(), AnotherActivity.class);
startActivity(intent);
}
});