How to recognize the native "back" button of the android device in an app.

Asked

Viewed 121 times

1

I would like to know how I do to detect in an application that user clicked on the device’s native "Back" button. 'Cause I need to take action if that happens.

1 answer

4

By the method:

@Override
public void onBackPressed() {
   //aqui você controla o voltar fisico do aparelho
}
  • Ah ok Leonardo. Thank you very much.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.