Code example for Fragment

Methods: getActivity, onViewCreated

0
		return v;
	} 
 
	@Override 
	public void onViewCreated(View view, Bundle savedInstanceState) {
		super.onViewCreated(view, savedInstanceState);
		tf = ((StandaloneDisplayActivity) getActivity()).getTypeFace();
		if (Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH)
			setupTextViewFont(view);
	} 
 
	public void setupTextViewFont(View view) {
		try { 
			if (view != null) {
				if (view instanceof ViewGroup) {
					for (int i = 0; i < ((ViewGroup) view).getChildCount(); i++) {
						setupTextViewFont(((ViewGroup) view).getChildAt(i));
					} 
				} else if (view instanceof TextView) {
					((TextView) view).setTypeface(tf);
				}