Android examples for User Interface:View Child
get Item Child View
//package com.java2s; import android.util.SparseArray; import android.view.View; public class Main { public static <T extends View> T getItemChildView(View convertView, int id) { SparseArray<View> viewHolder = (SparseArray<View>) convertView .getTag();//from w ww. j av a 2s . co m if (viewHolder == null) { viewHolder = new SparseArray<View>(); convertView.setTag(viewHolder); } View childView = viewHolder.get(id); if (childView == null) { childView = convertView.findViewById(id); viewHolder.put(id, childView); } return (T) childView; } }