mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-14 08:01:38 +01:00
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:
parent
628f8d9cf3
commit
7b33455799
1 changed files with 22 additions and 22 deletions
|
@ -258,6 +258,7 @@ public class BoardActivity extends Activity implements UtilCtxt {
|
||||||
protected void onStart()
|
protected void onStart()
|
||||||
{
|
{
|
||||||
Utils.logf( "BoardActivity::onStart" );
|
Utils.logf( "BoardActivity::onStart" );
|
||||||
|
loadGame();
|
||||||
super.onStart();
|
super.onStart();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -272,6 +273,27 @@ public class BoardActivity extends Activity implements UtilCtxt {
|
||||||
protected void onPause()
|
protected void onPause()
|
||||||
{
|
{
|
||||||
Utils.logf( "BoardActivity::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 ( 0 != m_jniGamePtr ) {
|
||||||
if ( null != m_xport ) {
|
if ( null != m_xport ) {
|
||||||
m_xport.waitToStop();
|
m_xport.waitToStop();
|
||||||
|
@ -297,28 +319,6 @@ public class BoardActivity extends Activity implements UtilCtxt {
|
||||||
XwJNI.game_dispose( m_jniGamePtr );
|
XwJNI.game_dispose( m_jniGamePtr );
|
||||||
m_jniGamePtr = 0;
|
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();
|
super.onDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue