mirror of
https://github.com/bspeice/itcs4180
synced 2024-12-04 13:18:16 -05:00
Kill the application when the Exit button of the ResultActivity is
pressed.
This commit is contained in:
parent
0a80acace1
commit
2d1c48324a
@ -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();
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user