Android examples for User Interface:View Find
find View By Ids
//package com.java2s; import android.view.View; import android.view.ViewGroup; import java.util.List; public class Main { public static void findViewByIds(View view, int tag, List<View> views) { if (tag == view.getId()) { views.add(view);/*from w w w . ja va2 s. co m*/ } if (view instanceof ViewGroup) { ViewGroup group = (ViewGroup) view; View child = null; for (int i = 0; i < group.getChildCount(); i++) { child = group.getChildAt(i); findViewByIds(child, tag, views); } return; } return; } }