Here you can find the source of setSelected(ViewGroup viewGroup, boolean selected)
public static void setSelected(ViewGroup viewGroup, boolean selected)
//package com.java2s; import android.view.ViewGroup; public class Main { public static void setSelected(ViewGroup viewGroup, boolean selected) { for (int i = 0; i < viewGroup.getChildCount(); i++) { viewGroup.getChildAt(i).setSelected(selected); }//from w w w . j a v a 2s. c om } }