mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-18 22:26:30 +01:00
override onNewIntent to inval games whose ids have changed
This commit is contained in:
parent
fffeceb665
commit
688fadb965
1 changed files with 25 additions and 13 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue