I think it will close your activity and all Sub activity related to it.
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();]
if (id == R.id.Exit) {
this.finishAffinity();
return true;
}
return super.onOptionsItemSelected(item);
}