Java tutorial
//package com.java2s; //License from project: Apache License import android.view.View; import android.view.ViewGroup; public class Main { public static void disableAllChildren(View view) { if (view instanceof ViewGroup) { ViewGroup viewGroup = (ViewGroup) view; for (int i = 0; i < viewGroup.getChildCount(); i++) { View child = viewGroup.getChildAt(i); child.setEnabled(false); disableAllChildren(child); } } } }