how to quit from android

i build an android version app and deploy it, but when push the return button , the app cant quit as pushing home button in iphone,
what can i do? thank you

I use the ‘back’ button to quit.

function Update ()
{
	if (Input.GetKey(KeyCode.Escape))
	{
            if (Application.platform == RuntimePlatform.Android)
            {
           		Application.Quit();
            }
	}
}

The architecture is structured so the app pauses when you for instance receive a phone call or pressing home. An app won't use much resources when paused. When pressing the home button on the iPhone it will also pause the application.

However when an app pauses it calls OnApplicationPause() so you're able to do something like this:

OnApplicationPause () {
    Application.Quit();
    //or
    System.Diagnostics.Process.GetCurrentProcess().Kill();
}

But it's not recommended. You should just let it continue in the background as when the user gets a phone call, he or she would most likely want to continue after hanging up.

Instead you could make a quit-button in the app for killing it entirely, and before that you have control over saving important data.

PlayerPrefs.Save();

var pt = System.Diagnostics.Process.GetCurrentProcess().Threads;

for(var p in pt){
      p.Dispose();
}

System.Diagnostics.Process.GetCurrentProcess().Kill();

I would not recoment to use:
System.Diagnostics.Process.GetCurrentProcess().Kill();
with Android.
I had some strange behavior, that the Writings to the Player-Prefs with
PlayerPrefs.SetString
where just gone, afte using that code.
Application.Quit();
will do.

void OnApplicationPause(bool pauseStatus) {

		if(pauseStatus) {
			System.Diagnostics.Process.GetCurrentProcess().Kill();
		}
		
	}

This is my lifesaver! Thanks a lot guys. It perfectly works for Android when i need to restart the application via deep linking in order to send different parameters via external url to the application.