This includes the key steps and should work to do what you want:
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// create ContextThemeWrapper from the original Activity Context with the
custom theme
Context context = new ContextThemeWrapper(getActivity(),
R.style.My_Custom_Theme);
// clone the inflater using the ContextThemeWrapper
LayoutInflater localInflater = inflater.cloneInContext(context);
// inflate using the cloned inflater, not the passed in default
return localInflater.inflate(R.layout.my_layout, container, false);
}
NOTE: the Context for your view is now a ContextThemeWrapper and not the
original context which can have subtle differences
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en