-
-
Save JacquesInnocent/2d286e74fbbd652ad78e4c66d1af3010 to your computer and use it in GitHub Desktop.
What do you want it to do? Explain what you want to do.
Navigating to a new activity. After hitting the buttonBack.
From the current activity (signupActivity) to (loginActivity)
You know how to use intents?
..I see the inteNT
buttonBack.setOnClickListener(View.OnClickListener() {
@OverRide
public void onClick (View v){
openLogin();
}
});
OR
buttonBack.setOnClickListener(View.OnClickListener() {
@OverRide
public void onClick (View v){
Intent intent = new Intent(this, loginActivity.class);
startActivity(intent);
}
});
buttonBack.setOnClickListener(this);
So you need an onclick method which listens for the id of the pressed button.
Okay I get it now.
This method is a class method.
public void onClick(View v) {
if(v == findViewById(R.id.Button1)){
//do here what u wanna do.
}
else if(v == findViewById(R.id.Button2)){
//do here what u wanna do.
}
else if(v == findViewById(R.id.Button3)){
//do here what u wanna do.
}
}
@Hitman23 check above.