how to get child from layout in android

Solutions on MaxInterview for how to get child from layout in android by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
showing results for - "how to get child from layout in android"
Alessia
09 Feb 2017
1LinearLayout layout = setupLayout();
2int count = layout.getChildCount();
3View v = null;
4for(int i=0; i<count; i++) {
5    v = layout.getChildAt(i);
6    //do something with your child element
7}
8