make constant string a static final rather than a resource.

This commit is contained in:
Eric House 2011-06-09 20:48:06 -07:00
parent 265ebc5e3e
commit dd97a81191
4 changed files with 10 additions and 12 deletions

View file

@ -68,8 +68,6 @@
<string name="key_notagain_arrow">key_notagain_arrow</string>
<string name="key_notagain_turnchanged">key_notagain_turnchanged</string>
<string name="relayids_extra">org.eehouse.android.xw4.relayids_extra</string>
<!-- other -->
<string name="default_host">eehouse.org</string>
<string name="dict_url">http://eehouse.org/and_dicts_hh</string>

View file

@ -33,6 +33,8 @@ import org.eehouse.android.xw4.jni.CommonPrefs;
public class DispatchNotify extends Activity {
public static final String RELAYIDS_EXTRA = "relayids";
public interface HandleRelaysIface {
void HandleRelaysIDs( final String[] relayIDs );
}
@ -47,14 +49,13 @@ public class DispatchNotify extends Activity {
super.onCreate( savedInstanceState );
Intent intent = getIntent();
String id = getString( R.string.relayids_extra );
String[] relayIDs = intent.getStringArrayExtra( id );
String[] relayIDs = intent.getStringArrayExtra( RELAYIDS_EXTRA );
if ( !tryHandle( this, relayIDs ) ) {
Utils.logf( "DispatchNotify: nothing running" );
intent = new Intent( this, GamesList.class );
intent.setFlags( Intent.FLAG_ACTIVITY_CLEAR_TOP );
intent.putExtra( id, relayIDs );
intent.putExtra( RELAYIDS_EXTRA, relayIDs );
startActivity( intent );
}

View file

@ -211,8 +211,7 @@ public class GamesList extends XWListActivity
protected void onNewIntent( Intent intent )
{
super.onNewIntent( intent );
String id = getString( R.string.relayids_extra );
invalRelayIDs( intent.getStringArrayExtra( id ) );
invalRelayIDs( intent.getStringArrayExtra( DispatchNotify.RELAYIDS_EXTRA ) );
startFirstHasDict( intent );
}
@ -530,8 +529,8 @@ public class GamesList extends XWListActivity
private void startFirstHasDict( Intent intent )
{
if ( null != intent ) {
String[] relayIDs = intent
.getStringArrayExtra( getString( R.string.relayids_extra ) );
String[] relayIDs =
intent.getStringArrayExtra( DispatchNotify.RELAYIDS_EXTRA );
startFirstHasDict( relayIDs );
}
}

View file

@ -71,8 +71,7 @@ public class RelayService extends Service {
private void setupNotification( String[] relayIDs )
{
Intent intent = new Intent( this, DispatchNotify.class );
intent.putExtra( getString(R.string.relayids_extra),
relayIDs );
intent.putExtra( DispatchNotify.RELAYIDS_EXTRA, relayIDs );
PendingIntent pi = PendingIntent.
getActivity( this, 0, intent,
@ -96,6 +95,7 @@ public class RelayService extends Service {
NotificationManager nm = (NotificationManager)
getSystemService( Context.NOTIFICATION_SERVICE );
nm.notify( R.string.relayids_extra, notification );
nm.notify( R.string.notify_body, // unique id; any will do
notification );
}
}