Android examples for User Interface:ViewGroup
get View from ViewGroup by path
//package com.java2s; import android.view.View; import android.view.ViewGroup; public class Main { public static View getView(ViewGroup root, int[] path) { ViewGroup current = root;//from w w w.j a v a2s . co m for (int i = 0; i < path.length; i++) { if (current.getChildCount() <= path[i]) { return null; } View child = current.getChildAt(path[i]); if (i == path.length - 1) { return child; } if (!(child instanceof ViewGroup)) { return null; } current = (ViewGroup) child; } return null; } }