Define onClick attribute of button with function to be called as value of the attribute.
<Button .... android:onClick = login />
where login is the name of function that is called when button is clicked.
Now define Intent object inside this login() function.
Intent myIntent = new Intent( this, DashBoard.class); startActivity(myIntent);
You need to add second activity name in AndroidManifest.xml file to make operating system know about the existence of second activity.
<activity android:name=".DashBoard" android:label="@string/app_name" />
This is step that we usually forget to do. So keep in mind.