Android examples for User Interface:View Child
Get all children view from View
//package com.java2s; import android.support.annotation.NonNull; import android.view.View; import android.view.ViewGroup; import java.util.ArrayList; import java.util.List; public class Main { public static List<View> children(@NonNull final View view) { final List<View> views = new ArrayList<>(); final ViewGroup viewGroup = (ViewGroup) view; for (int i = 0; i < viewGroup.getChildCount(); i++) { final View v = viewGroup.getChildAt(i); views.add(v);//w w w. jav a 2s . c om } return views; } }