Arduino Uno

Header

Corner

Back-Button

Detecting android device hardware back button / soft back button press is very easy. But be careful while overriding the default back button action as it is not suggested to change the android default user experience.

 
@Override
public void onBackPressed() 
{
	// Write your code here
        super.onBackPressed();
}

 Source