private ArrayListgetAllChildren(View v) { if (!(v instanceof ViewGroup)) { ArrayList viewArrayList = new ArrayList (); viewArrayList.add(v); return viewArrayList; } ArrayList result = new ArrayList (); ViewGroup viewGroup = (ViewGroup) v; for (int i = 0; i < viewGroup.getChildCount(); i++) { View child = viewGroup.getChildAt(i); ArrayList viewArrayList = new ArrayList (); viewArrayList.add(v); viewArrayList.addAll(getAllChildren(child)); result.addAll(viewArrayList); } return result; }
Hiç yorum yok:
Yorum Gönder