I have an Android application where if the user creates an account, they click on the "create an account" button, it takes them to a second activity (DriverDetailsActivity) to fill out a form. Once the form is completed, the user will then click on the "UPDATE" button which will return them to the LoginActivity and the "Create an Account" text should change to "Register" but it is not working.
The code I am supplying isn't working.
LoginActivity:
final Button mRegisterButton = (Button)findViewById(R.id.email_registration_button);
mRegisterButton.setTag(1);
mRegisterButton.setText("Create an Account");
mRegisterButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick (View v) {
final int status = (Integer) v.getTag();
if (status == 1) {
Intent intent = new Intent(getBaseContext(), DriverDetailsActivity.class);
startActivity(intent);
mRegisterButton.setText("Register");
}
}
});
DriverDetailsActivity (2nd Activity)
// Once completed all fields, user is sent back to DriverLoginActivity
update.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(DriverDetailsActivity.this, DriverLoginActivity.class);
startActivity(intent);
}
});
How can I do this?