From fffeceb665e0aeff0974189e3fd9640cf2296aaa Mon Sep 17 00:00:00 2001 From: Andy2 Date: Mon, 14 Feb 2011 07:06:16 -0800 Subject: [PATCH] include list of changed relayIDs in intent used to relaunch GamesList. --- .../eehouse/android/xw4/DispatchNotify.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DispatchNotify.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DispatchNotify.java index d2a29ce58..8d030a166 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DispatchNotify.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DispatchNotify.java @@ -47,12 +47,15 @@ public class DispatchNotify extends Activity { super.onCreate( savedInstanceState ); Intent intent = getIntent(); - String[] relayIDs = - intent.getStringArrayExtra( getString(R.string.relayids_extra) ); + String id = getString( R.string.relayids_extra ); + String[] relayIDs = intent.getStringArrayExtra( id ); if ( !tryHandle( this, relayIDs ) ) { Utils.logf( "DispatchNotify: nothing running" ); - startActivity( new Intent( this, GamesList.class ) ); + intent = new Intent( this, GamesList.class ); + // intent.setFlags( Intent.FLAG_ACTIVITY_SINGLE_TOP ); + intent.putExtra( id, relayIDs ); + startActivity( intent ); } finish(); @@ -82,21 +85,19 @@ public class DispatchNotify extends Activity { public static boolean tryHandle( Context context, String[] relayIDs ) { Utils.logf( "tryHandle()" ); - boolean handled = true; + boolean handled = false; if ( null != s_handler ) { + // This means the GamesList activity is frontmost Utils.logf( "calling m_handler" ); s_handler.HandleRelaysIDs( relayIDs ); - } else if ( s_running.isEmpty() ) { - Utils.logf( "m_running is empty" ); - handled = false; + handled = true; } else { - Utils.logf( "DispatchNotify: something running" ); - for ( Activity activity : s_running ) { if ( activity instanceof DispatchNotify.HandleRelaysIface ) { DispatchNotify.HandleRelaysIface iface = (DispatchNotify.HandleRelaysIface)activity; iface.HandleRelaysIDs( relayIDs ); + handled = true; } } }