I have a login form and a button which when click starts another activity. But after pressing the back button on the bottom left of the phone, it navigates back to the login activity. How can I prevent this. This is what I've been working with :-
loginButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(LoginActivity.this, HomeActivity.class));
}
});