Android : How to access child elements inside a TableRow in android?

on Saturday, August 16, 2014


My layout file has a structure like:



<TableRow>
<LinearLayout >

<LinearLayout >
<IconTextView />
</LinearLayout>

<TextView />

</LinearLayout>

<!-- The above linear layout is repeated 4 times in a table row -->
</TableRow>


All the elements inside the table row are generated dynamically through code and they do not have IDs. So how do i access the IconTextView and TextView inside every TableRow?


I access each child (outer LinearLayout) inside every TableRow with the help of getChildCount() and getChildAt() functions.


Now I want a similar way to access different elements inside the child (for example IconTextView and TextView)


0 comments:

Post a Comment