1LinearLayout rootLinearLayout = (LinearLayout) findViewById(R.id.rootLinearLayout);
2int count = rootLinearLayout.getChildCount();
3for (int i = 0; i < count; i++) {
4 View v = rootLinearLayout.getChildAt(i);
5 if (v instanceof LinearLayout) {
6 ...
7 }
8}