So I am currently creating an app and one of the small things that have been bothering me is the fact that I have to click a button twice for it to work.
This is my code and I can't see anything wrong with it:
public void signUpButtonClickAction(View v){
    Button signUpButtonClick = (Button) findViewById(R.id.signUpButton);
    signUpButtonClick.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            startActivity(new Intent(MainActivity.this, Signup.class));
        }
    });
}
xml code for my button:
<Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/signUps"
    android:id="@+id/signUpButton"
    android:layout_marginBottom="38dp"
    android:layout_alignParentBottom="true"
    android:layout_centerHorizontal="true"
    android:onClick="signUpButtonClickAction"/>
It is probably a small fix but even I can't spot this bug
 
     
     
     
     
     
     
    