Back to project page cicada.
The source code is released under:
Apache License
If you think the Android project cicada listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package org.cicadasong.samples.tubestatus; //from w w w . j a v a2s . co m import org.cicadasong.samples.tubestatus.TubeStatus.TubeLine; import android.content.Context; import android.os.Bundle; import android.preference.ListPreference; import android.preference.PreferenceActivity; public class TubeStatusSettingsActivity extends PreferenceActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getPreferenceManager().setSharedPreferencesName(Preferences.PREFS_NAME); getPreferenceManager().setSharedPreferencesMode(Context.MODE_PRIVATE); addPreferencesFromResource(R.xml.preferences); updatePreferredLineList(); } private void updatePreferredLineList() { ListPreference p = (ListPreference) findPreference("PreferredLine"); int lineCount = TubeLine.allLines.size(); CharSequence[] titles = new CharSequence[lineCount]; CharSequence[] values = new CharSequence[lineCount]; for (int index = 0; index < lineCount; index++) { titles[index] = TubeLine.allLines.get(index).name; values[index] = TubeLine.allLines.get(index).lineIdentifier; } p.setEntries(titles); p.setEntryValues(values); } }