I have a PreferenceActivity, among other things, a category, including call forwarding options. I want this preference:
- Enables / disables if the user clicks the checkbox on the right.
- Opens the EditTextPreference dialog if the user clicks on the text (or something else in preference)
This is probably not used, but here is a snippet of this particular category of preferences:
<PreferenceCategory android:title="@string/category_callforward"> <EditTextPreference android:key="call_forward_always" android:title="@string/call_forward_always" android:summary="@string/call_forward_forwardto" /> </PreferenceCategory>
EDIT
I would like to implement it in this method, if possible:
// Locates the correct data from saved preferences and sets input type to numerics only private void setCallForwardType() { ep1 = (EditTextPreference) findPreference("call_forward_always"); EditText et = (EditText) ep1.getEditText(); et.setKeyListener(DigitsKeyListener.getInstance()); }
EDIT2
If anyone is still interested, this is what I want as a preference:

EDIT3
I searched for a couple of hours and came up with one word: "PreferenceGroupAdapter". However, I could not find examples or tutorials showing how to use them. Suggestions? Is this even the right way?
EDIT4
If this is really not possible, I would very much like to propose an alternative (user-friendly) solution that I can implement instead of the combined selection of Edit and Checkbox.
source share