Have you tried this and found a problem?
You will need to make this line
LinearLayout LinLayBtn = (LinearLayout)findViewWithTag("1");
matches the naming scheme you used when setting the tag. So you would like something similar in your example:
LinearLayout LinLayBtn = (LinearLayout)findViewWithTag("id1");
If you need to do many of these searches, although this is probably the best approach for storing view references in an array when creating them, so you don't need to have all the findView calls. Or, for example, @Muhammad suggested using parent.getChild (index i);
Foamyguy
source share