Here you can find the source of switchVisible(ViewGroup viewGroup, View _view)
public static void switchVisible(ViewGroup viewGroup, View _view)
//package com.java2s; import android.view.View; import android.view.ViewGroup; public class Main { public static void switchVisible(ViewGroup viewGroup, int id) { for (int i = 0; i < viewGroup.getChildCount(); i++) { View view = viewGroup.getChildAt(i); if (view.getId() == id) { view.setVisibility(View.VISIBLE); } else { view.setVisibility(View.GONE); }//from ww w .jav a 2 s. c o m } } public static void switchVisible(ViewGroup viewGroup, View _view) { for (int i = 0; i < viewGroup.getChildCount(); i++) { View view = viewGroup.getChildAt(i); if (_view == view) { view.setVisibility(View.VISIBLE); } else { view.setVisibility(View.GONE); } } } }