Android examples for User Interface:ViewGroup
set ViewGroup Font
//package com.java2s; import android.graphics.Typeface; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; public class Main { private static void setFont(ViewGroup vg, Typeface tf) { int childCount = vg.getChildCount(); for (int i = 0; i < childCount; i++) { View view = vg.getChildAt(i); if (view instanceof ViewGroup) { setFont((ViewGroup) view, tf); }/* ww w . ja va 2 s.c o m*/ if (view instanceof TextView) { ((TextView) view).setTypeface(tf); } } } }