Skip to content

Instantly share code, notes, and snippets.

@Sloy
Sloy / AutoSummaryListPreference
Created June 29, 2013 13:16
Android custom ListPreference which shows its selected value as summary, as suggested in the official guidelines. No need to use OnPreferenceChangeListener in the Activity or anything like that. Only assign entries and entryValues.
package com.your.package;
import android.content.Context;
import android.preference.ListPreference;
import android.util.AttributeSet;
/**
* Created by Rafa Vázquez on 29/06/13.
*
* ListPreference item that shows its selected value as summary.