Answers for "android studio find all views in layout"

0

android studio find all views in layout

LinearLayout rootLinearLayout = (LinearLayout) findViewById(R.id.rootLinearLayout);
int count = rootLinearLayout.getChildCount();
for (int i = 0; i < count; i++) {
    View v = rootLinearLayout.getChildAt(i);
    if (v instanceof LinearLayout) {
        ...
    }
}
Posted by: Guest on August-04-2020

Code answers related to "android studio find all views in layout"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language