In .xml file
<TextView android:id="@+id/sgn" android:layout_width="match_parent" android:layout_height="wrap_content" **android:text="Sign Up"**> </TextView> In .xml file
<TextView android:id="@+id/sgn" android:layout_width="match_parent" android:layout_height="wrap_content" **android:text="Sign Up"**> </TextView> sgn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { startActivity(new Intent(getApplicationContext() , RegisterActivity2.class)); finish(); } });