Android: dynamically cycle through layout items -


not sure if head line describes well, want that:

i have let's 9 textviews in layout, named tv1, tv2, ..., tv9.

of course can access each of them with

 textview tv11 = (textview) findviewbyid(r.id.tv1) 

lot's of typing, rather have loop , loop through these items, how can include findviewbyid loop can change value accordingly?

is there reason why can't iterate on children of containing viewgroup? number of children getchildcount , can access each individual child getchildat.

you may have test whether particularly child instance of textview if have other views in layout, basic concept straightforward.


Comments