From 467e999509a60fe85e1825cf2678fcdc8d2e57fa Mon Sep 17 00:00:00 2001 From: Andy2 Date: Wed, 2 Mar 2011 06:48:14 -0800 Subject: [PATCH] set and clear dbchange listener in onCreate and onDestroy rather than onStart and onPause so it'll get called when not in front too. Not sure why this worked before the GameLock change.... --- .../src/org/eehouse/android/xw4/GamesList.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesList.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesList.java index 34041e75c..752cea325 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesList.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesList.java @@ -197,6 +197,8 @@ public class GamesList extends XWListActivity NetUtils.informOfDeaths( this ); startFirstHasDict( getIntent() ); + + DBUtils.setDBChangeListener( this ); } // onCreate @Override @@ -215,7 +217,6 @@ public class GamesList extends XWListActivity { super.onStart(); DispatchNotify.SetRelayIDsHandler( this ); - DBUtils.setDBChangeListener( this ); // TelephonyManager mgr = // (TelephonyManager)getSystemService( Context.TELEPHONY_SERVICE ); @@ -231,12 +232,18 @@ public class GamesList extends XWListActivity // (TelephonyManager)getSystemService( Context.TELEPHONY_SERVICE ); // mgr.listen( m_phoneStateListener, PhoneStateListener.LISTEN_NONE ); // m_phoneStateListener = null; - DBUtils.clearDBChangeListener( this ); DispatchNotify.SetRelayIDsHandler( null ); super.onStop(); } + @Override + protected void onDestroy() + { + DBUtils.clearDBChangeListener( this ); + super.onDestroy(); + } + // DispatchNotify.HandleRelaysIface interface public void HandleRelaysIDs( final String[] relayIDs ) {