fragment:
final Context contextThemeWrapper = new ContextThemeWrapper(getActivity(), R.style.Widget_MainTabPageIndicator);
LayoutInflater localInflater = inflater.cloneInContext(contextThemeWrapper);
mRootView = localInflater.inflate(R.layout.fragment_main, container, false);
view:
final View tabView = new View (new ContextThemeWrapper(getContext(), defaultStyle));
textView
textView.setTextAppearance(context, R.style.mystyle);
RelativeLayout someLayout = new RelativeLayout(context, null, R.style.LightStyle);