I'm trying to set a theme for a fragment within an activity.
When I set the fragment theme in the onCreate function of the fragment using the inflator as described in Set a theme for a fragment like this:
var contextThemeWrapper = ContextThemeWrapper(getActivity(), R.style.FragmentTheme);
var localInflater = inflater.cloneInContext(contextThemeWrapper)
return localInflater.inflate(R.layout.fragment_component_indicator, container, false)
or in the layout of the fragment XML, the theme for the fragment does not take effect.
Using the Layout Inspector, I see that the theme does get added to the fragment layout but the activity theme is still there:
Any tips on how I can set the theme of the fragment?
Thank you.