Android examples for User Interface:View Enable
set View Enabled State
//package com.java2s; import android.view.View; import android.view.ViewGroup; public class Main { public static void setViewEnabledState(View view, boolean enabled) { view.setEnabled(enabled);//from w w w .j ava2 s . co m if (view instanceof ViewGroup) { ViewGroup group = (ViewGroup) view; for (int idx = 0; idx < group.getChildCount(); idx++) { setViewEnabledState(group.getChildAt(idx), enabled); } } } }