mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-30 08:34:16 +01:00
include list of changed relayIDs in intent used to relaunch GamesList.
This commit is contained in:
parent
be4bb3a73e
commit
fffeceb665
1 changed files with 10 additions and 9 deletions
|
@ -47,12 +47,15 @@ public class DispatchNotify extends Activity {
|
||||||
super.onCreate( savedInstanceState );
|
super.onCreate( savedInstanceState );
|
||||||
|
|
||||||
Intent intent = getIntent();
|
Intent intent = getIntent();
|
||||||
String[] relayIDs =
|
String id = getString( R.string.relayids_extra );
|
||||||
intent.getStringArrayExtra( getString(R.string.relayids_extra) );
|
String[] relayIDs = intent.getStringArrayExtra( id );
|
||||||
|
|
||||||
if ( !tryHandle( this, relayIDs ) ) {
|
if ( !tryHandle( this, relayIDs ) ) {
|
||||||
Utils.logf( "DispatchNotify: nothing running" );
|
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();
|
finish();
|
||||||
|
@ -82,21 +85,19 @@ public class DispatchNotify extends Activity {
|
||||||
public static boolean tryHandle( Context context, String[] relayIDs )
|
public static boolean tryHandle( Context context, String[] relayIDs )
|
||||||
{
|
{
|
||||||
Utils.logf( "tryHandle()" );
|
Utils.logf( "tryHandle()" );
|
||||||
boolean handled = true;
|
boolean handled = false;
|
||||||
if ( null != s_handler ) {
|
if ( null != s_handler ) {
|
||||||
|
// This means the GamesList activity is frontmost
|
||||||
Utils.logf( "calling m_handler" );
|
Utils.logf( "calling m_handler" );
|
||||||
s_handler.HandleRelaysIDs( relayIDs );
|
s_handler.HandleRelaysIDs( relayIDs );
|
||||||
} else if ( s_running.isEmpty() ) {
|
handled = true;
|
||||||
Utils.logf( "m_running is empty" );
|
|
||||||
handled = false;
|
|
||||||
} else {
|
} else {
|
||||||
Utils.logf( "DispatchNotify: something running" );
|
|
||||||
|
|
||||||
for ( Activity activity : s_running ) {
|
for ( Activity activity : s_running ) {
|
||||||
if ( activity instanceof DispatchNotify.HandleRelaysIface ) {
|
if ( activity instanceof DispatchNotify.HandleRelaysIface ) {
|
||||||
DispatchNotify.HandleRelaysIface iface =
|
DispatchNotify.HandleRelaysIface iface =
|
||||||
(DispatchNotify.HandleRelaysIface)activity;
|
(DispatchNotify.HandleRelaysIface)activity;
|
||||||
iface.HandleRelaysIDs( relayIDs );
|
iface.HandleRelaysIDs( relayIDs );
|
||||||
|
handled = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue