Reputation: 2217
I am working on a custom ViewGroup that extends LinearLayout but only accepts children of a particular subclass. At the first possible moment I have the opportunity, I want to set some properties on the children (things like their index etc). In Flex there is a method called createChildren() where all children are created and then an event called creationComplete is fired (the children are created but not measured/laid out yet). Whats the equivalent in Android?
Upvotes: 1
Views: 223
Reputation: 14136
Is there a reason for adding properties to the view before it is drawn? If not than you can use myViewGroup.setTag(myObjectTag)
to attach an object to the view (perhaps Integer since you want to use it to index) and myViewGroup.getTag()
to return the view's object "tag".
Upvotes: 1