java – How to configure back button action on android?

Question:

How to perform certain activities in the app when the back button is heard?

Answer:

Hello Friend!

@Override
public void onBackPressed() 
{
    //Seu código aqui dentro
}
Scroll to Top