fix string (which should not be hard-coded!) and use new class.

This commit is contained in:
Andy2 2010-10-16 10:48:59 -07:00
parent 02ea8b13e0
commit 91e95eb48b

View file

@ -45,14 +45,14 @@ public class PollListPreference extends ListPreference
{
// String key = getString( R.string.key_connect_frequency );
String val = getPersistedString( "0" );
setSummary( String.format( "%s minutes", val ) );
setSummary( String.format( "%s seconds", val ) );
}
// Preference.OnPreferenceChangeListener interface
public boolean onPreferenceChange( Preference preference, Object newValue )
{
int val = Integer.parseInt((String)newValue);
RelayActivity.RestartTimer( m_context, val * 1000 );
RelayReceiver.RestartTimer( m_context, val * 1000 );
setSummary( String.format( "%d seconds", val ) );
return true;
}