One option for creating a subcategory is to use the nested settings screen by switching the CheckBoxPreference custom checkboxes to the PreferenceScreen tag and closing it after three configurable settings. When the custom flash card option is clicked, a new screen appears with three checkbox options.
<PreferenceCategory android:key="flashcard_selection" android:title="Flashcard Selection"> <CheckBoxPreference android:defaultValue="true" android:key="all_flashcards" android:summary="Display All Flashcards" android:title="All Flashcards" /> <PreferenceScreen android:defaultValue="false" android:key="custom_flashcards" android:summary="Display a customized list of flashcards" android:title="Custom Flashcards" > <CheckBoxPreference android:defaultValue="false" android:dependency="custom_flashcards" android:key="red_flashcards" android:summary="Display Red Flashcards" android:title="Red" /> <CheckBoxPreference android:defaultValue="false" android:dependency="custom_flashcards" android:key="yellow_flashcards" android:summary="Display Yellow Flashcards" android:title="Yellow" /> <CheckBoxPreference android:defaultValue="false" android:dependency="custom_flashcards" android:key="green_flashcards" android:summary="Display Green Flashcards" android:title="Green" /> </PreferenceScreen> </PreferenceCategory>
Dave justen
source share