move game-close logic from onPause to onDestroy. Makes for much

faster resume and seems ok.  But need to do some saving in onPause so
no data's lost if we're killed without onDestroy getting called.
This commit is contained in:
eehouse 2010-06-03 04:57:27 +00:00
parent 628f8d9cf3
commit 7b33455799

View file

@ -258,6 +258,7 @@ public class BoardActivity extends Activity implements UtilCtxt {
protected void onStart()
{
Utils.logf( "BoardActivity::onStart" );
loadGame();
super.onStart();
}
@ -272,6 +273,27 @@ public class BoardActivity extends Activity implements UtilCtxt {
protected void onPause()
{
Utils.logf( "BoardActivity::onPause()" );
super.onPause();
}
@Override
protected void onResume()
{
Utils.logf( "BoardActivity::onResume()" );
super.onResume();
}
@Override
protected void onStop()
{
Utils.logf( "BoardActivity::onStop()" );
super.onStop();
}
@Override
protected void onDestroy()
{
Utils.logf( "BoardActivity::onDestroy()" );
if ( 0 != m_jniGamePtr ) {
if ( null != m_xport ) {
m_xport.waitToStop();
@ -297,28 +319,6 @@ public class BoardActivity extends Activity implements UtilCtxt {
XwJNI.game_dispose( m_jniGamePtr );
m_jniGamePtr = 0;
}
super.onPause();
}
@Override
protected void onResume()
{
Utils.logf( "BoardActivity::onResume()" );
loadGame();
super.onResume();
}
@Override
protected void onStop()
{
Utils.logf( "BoardActivity::onStop()" );
super.onStop();
}
@Override
protected void onDestroy()
{
Utils.logf( "BoardActivity::onDestroy()" );
super.onDestroy();
}