Possible Duplicate:
android - exit application code
I am finding the way to exit android application to home screen(android phone).
My code is not completely exit application but it turn to the root activity of application.
Here is my code
//Expression
Button exit = (Button) findViewById(R.id.exit);
exit.setOnClickListener(new OnClickListener()
{
@Override
public void onClick(View v)
{
// TODO Auto-generated method stub
finish();
System.exit(0);
}
});
Can you tell me how to exit application and go to home screen of android phone?
Regards,