public ListgetAllChildViews() { View view = this.getWindow().getDecorView(); return getAllChildViews(view); } private List getAllChildViews(View view) { List allchildren = new ArrayList (); if (view instanceof ViewGroup) { ViewGroup vp = (ViewGroup) view; for (int i = 0; i < vp.getChildCount(); i++) { View viewchild = vp.getChildAt(i); allchildren.add(viewchild); allchildren.addAll(getAllChildViews(viewchild)); } } return allchildren; }