The XML file of my ListPreference
<ListPreference android:key="lpBirim" android:title="Birim"
android:summary="" android:defaultValue="0" android:persistent="false"/>
How to get the selected text and the selected value?
The XML file of my ListPreference
<ListPreference android:key="lpBirim" android:title="Birim"
android:summary="" android:defaultValue="0" android:persistent="false"/>
How to get the selected text and the selected value?
You can use this snippet to get the value:
Have look on the tutorial
Here is an example:
in your PreferenceActivity do something like:
You can use
findPreference()
to get aListPreference
that has all methods you need. To have it working you need to use or extendPreferenceFragment
first.