Back to project page slider.
The source code is released under:
Apache License
If you think the Android project slider 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 de.devisnik.android.sliding; /* w ww . ja v a 2s. c o m*/ import java.util.Arrays; import android.preference.ListPreference; import android.preference.Preference; class SummaryUpdater implements Preference.OnPreferenceChangeListener { @Override public boolean onPreferenceChange(Preference preference, Object newValue) { if (preference instanceof ListPreference) updateListSummary((ListPreference)preference, (String) newValue); else updateSummary(preference, (String) newValue); return true; } void updateListSummary(ListPreference listPreference, String newValue) { int entryIndex = Arrays.asList(listPreference.getEntryValues()).indexOf(newValue); listPreference.setSummary(listPreference.getEntries()[entryIndex]); } void updateSummary(Preference preference, String newValue) { preference.setSummary(newValue); } }