Java tutorial
//package com.java2s; import android.view.View; import android.view.ViewGroup; public class Main { public static void enableDisableView(View view, boolean enabled) { view.setEnabled(enabled); if (view instanceof ViewGroup) { ViewGroup group = (ViewGroup) view; for (int id = 0; id < group.getChildCount(); id++) { enableDisableView(group.getChildAt(id), enabled); } } } }