Last active
June 6, 2019 04:12
-
-
Save brunomateus/5617025 to your computer and use it in GitHub Desktop.
Android ListPreference with summary updated automatically
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ListPreferenceWithSummary extends ListPreference{ | |
public ListPreferenceWithSummary(Context context, AttributeSet attrs) { | |
super(context, attrs); | |
} | |
public ListPreferenceWithSummary(Context context) { | |
super(context); | |
} | |
@Override | |
public void setValue(String value) { | |
super.setValue(value); | |
setSummary(value); | |
} | |
@Override | |
public void setSummary(CharSequence summary) { | |
super.setSummary(getEntry()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment