But is this a recommended way of doing preferences, a convention, or does is just happen to be that way in the tutorial?
No, you don't need to set keys for your PreferenceCategories
, if you're not doing anything with them.
You can add Preferences
to your PreferenceCategory
by accessing it with findPreference(your_preference_category_key)
and then calling addPreference(...)
on it. But since you're not doing that you don't need to set any key for it.