include game name in notification text

This commit is contained in:
Eric House 2012-05-21 06:40:52 -07:00
parent 469f63f96f
commit f56b09980c
2 changed files with 14 additions and 7 deletions

View file

@ -1500,7 +1500,7 @@
device, and the body that appears when you pull the notifications
down. -->
<string name="notify_title">Moves made</string>
<string name="notify_body">New game moves have arrived</string>
<string name="notify_bodyf">Activity in game "%s"</string>
<!--
############################################################

View file

@ -60,12 +60,19 @@ public class RelayService extends Service {
private void setupNotification( String[] relayIDs )
{
Intent intent = new Intent( this, DispatchNotify.class );
intent.putExtra( DispatchNotify.RELAYIDS_EXTRA, relayIDs );
for ( String id : relayIDs ) {
Utils.postNotification( this, intent, R.string.notify_title,
R.string.notify_body, id.hashCode() );
for ( String relayID : relayIDs ) {
long[] rowids = DBUtils.getRowIDsFor( this, relayID );
if ( null != rowids ) {
for ( long rowid : rowids ) {
Intent intent = new Intent( this, DispatchNotify.class );
intent.putExtra( DispatchNotify.RELAYIDS_EXTRA,
new String[] {relayID} );
String msg = Utils.format( this, R.string.notify_bodyf,
GameUtils.getName( this, rowid ) );
Utils.postNotification( this, intent, R.string.notify_title,
msg, relayID.hashCode() );
}
}
}
}