How can you implement a RadioButtonPreference in android? Just like the CheckBoxPreference.
Are there any workarounds?
How can you implement a RadioButtonPreference in android? Just like the CheckBoxPreference.
Are there any workarounds?
Use a ListPreference
. You need to have more than one radio button for it to be meaningful (otherwise, it would just be a checkbox).
If, for some reason, you do not want to use a ListPreference
, grab the source code to CheckBoxPreference
from the Android open source tree and roll your own Preference implementation. You should then be able to list your custom implementation in preference XML using the namespace (e.g., com.foo.RadioButtonPreference
).