Kill the application when the Exit button of the ResultActivity is

pressed.
master
DjBushido 2014-02-24 22:30:44 -05:00
parent 0a80acace1
commit 2d1c48324a
2 changed files with 9 additions and 2 deletions

View File

@ -38,6 +38,10 @@ public class MainActivity extends Activity
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// If the result activity calls us with an EXIT in the extras, quit.
if (getIntent().getBooleanExtra("EXIT", false))
finish();
newGame((View)findViewById(R.id.LinearLayout1));
focusImages.get(focusIndex).show();
}

View File

@ -55,8 +55,11 @@ public class ResultActivity extends Activity {
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
}
else if (v.getId() == R.id.btnExit)
finish();
else if (v.getId() == R.id.btnExit){
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
intent.putExtra("EXIT", true);
startActivity(intent);
}
}
}