set View Group Enabled - Android User Interface

Android examples for User Interface:View Enable

Description

set View Group Enabled

Demo Code


//package com.java2s;

import android.view.View;
import android.view.ViewGroup;

public class Main {
    public static void setViewGroupEnabled(ViewGroup group,
            boolean isEnabled) {
        for (int i = 0; i < group.getChildCount(); i++) {
            View child = group.getChildAt(i);
            child.setEnabled(isEnabled);
            if (child instanceof ViewGroup)
                setViewGroupEnabled((ViewGroup) child, isEnabled);
        }/*from w ww. ja v  a2  s.c  o  m*/
    }
}

Related Tutorials