Java tutorial
//package com.java2s; //License from project: Open Source License import android.view.View; import android.view.ViewGroup; public class Main { public static void stateControls(boolean able, ViewGroup vg) { for (int i = 0; i < vg.getChildCount(); i++) { View child = vg.getChildAt(i); child.setEnabled(able); if (child instanceof ViewGroup) { stateControls(able, (ViewGroup) child); } } } }