Android back button exit code

Hi

I do not know the code of the button’s handler android back in version 2.
Previously in version 1.6 I am used this

function exitFromApp ()
{
navigator.app.exitApp ();
};

How do I do this in version 2?

Thank you.