Is there a way to obtain a child element of a LinearLayout? My code returns a view (linearlayout), but I need to get access to specific elements inside of the layout.
<You can do like this.
ViewGroup layoutCont= (ViewGroup) findViewById(R.id.linearLayout);
getAllChildElements(layoutCont);
public static final void getAllChildElements(ViewGroup layoutCont) {
if (layoutCont == null) return;
final int mCount = layoutCont.getChildCount();
// Loop through all of the children.
for (int i = 0; i < mCount; ++i) {
final View mChild = layoutCont.getChildAt(i);
if (mChild instanceof ViewGroup) {
// Recursively attempt another ViewGroup.
setAppFont((ViewGroup) mChild, mFont);
} else {
// Set the font if it is a TextView.
}
}
}