I'm using PreferenceFragment
to inflate preferences from a xml. In my xml, I have a preference subscreen. When I click on this preference, a new preference screen is showed. To do that, as google documentation says, I have declared another preference screen in my xml file like this:
<PreferenceCategory android:title="@string/pref_info_section">
<PreferenceScreen
android:key="LegalPref"
android:title="@string/legal"
android:persistent="false">
<Preference
android:key="PolicyPref"
android:title="@string/policy">
</Preference>
<Preference
android:key="OpenSourcePref"
android:title="@string/open_source">
</Preference>
</PreferenceScreen>
</PreferenceCategory>
The problem is that when I click on this preference item and the new screen is shown, my toolbar disappears, and only the secondary preference options are showed. The activity containing this preference fragment uses Theme.AppCompat.Light
witch shows a toolbar at first, but when I click in the preference subscreen (which automatically shows the other preference options without create a new activity), the toolbar disappear.