Android examples for User Interface:View Child
set Visibility To All Children View Except
//package com.java2s; import android.view.View; import android.view.ViewGroup; public class Main { public static void setVisibilityToAllChildrenExcept(ViewGroup group, int visibility, View... exceptions) { for (int i = 0; i < group.getChildCount(); i++) { View child = group.getChildAt(i); boolean shouldApplyVisibility = true; for (View exception : exceptions) { if (exception == child) { shouldApplyVisibility = false; break; }/* ww w . j av a 2 s. c o m*/ } if (shouldApplyVisibility) { child.setVisibility(visibility); } } } }