override onNewIntent to inval games whose ids have changed

This commit is contained in:
Andy2 2011-02-14 07:07:05 -08:00
parent fffeceb665
commit 688fadb965

View file

@ -218,6 +218,16 @@ public class GamesList extends XWListActivity
NetUtils.informOfDeaths( this );
}
@Override
// called when we're brought to the front (probably as a result of
// notification)
protected void onNewIntent( Intent intent )
{
super.onNewIntent( intent );
String id = getString( R.string.relayids_extra );
invalRelayIDs( intent.getStringArrayExtra( id ) );
}
@Override
protected void onStart()
{
@ -249,19 +259,7 @@ public class GamesList extends XWListActivity
{
m_handler.post( new Runnable() {
public void run() {
if ( null == relayIDs ) {
Utils.logf( "relayIDs null" );
} else if ( relayIDs.length == 0 ) {
Utils.logf( "relayIDs empty" );
} else {
for ( String relayID : relayIDs ) {
Utils.logf( "HandleRelaysIDs: got %s", relayID );
String path = DBUtils.getPathFor( GamesList.this,
relayID );
m_adapter.inval( path );
}
onContentChanged();
}
invalRelayIDs( relayIDs );
}
} );
}
@ -528,4 +526,18 @@ public class GamesList extends XWListActivity
onContentChanged();
return path;
}
private void invalRelayIDs( String[] relayIDs )
{
if ( null == relayIDs ) {
Utils.logf( "relayIDs empty" );
} else {
for ( String relayID : relayIDs ) {
Utils.logf( "got relayID %s", relayID );
String path = DBUtils.getPathFor( this, relayID );
m_adapter.inval( path );
}
onContentChanged();
}
}
}