mirror of
https://github.com/bspeice/itcs4180
synced 2025-04-20 23:01:34 -04: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);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_main);
|
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));
|
newGame((View)findViewById(R.id.LinearLayout1));
|
||||||
focusImages.get(focusIndex).show();
|
focusImages.get(focusIndex).show();
|
||||||
}
|
}
|
||||||
|
@ -55,8 +55,11 @@ public class ResultActivity extends Activity {
|
|||||||
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
else if (v.getId() == R.id.btnExit)
|
else if (v.getId() == R.id.btnExit){
|
||||||
finish();
|
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||||
|
intent.putExtra("EXIT", true);
|
||||||
|
startActivity(intent);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user