-3

I am programming on Android Studio. I use different intents, but, when I press "return key", on my phone, I come back to the last intent. I would like to avoid it. I want, that if your press "return key", the app just finishes. How can I do it? Maybe, erasing the intent historial?

Thank you

1 Answers1

-1

you can overwrite the on back method:

@Override
    public void onBackPressed() {
        super.onBackPressed();
        finish();
}

this should do the trick.