android - Custom linearlayout, on constructor get all childviews -


im having problem custom linearylayout, class inherits linearlayout.. nothing fancy.. thing need fetch child-views thats inside custom linearlayout.. have tried:

this.getchildcount(); 

but keeps returning zero, , im starting think maybe children hasent been added yet during time run code in constructor?

thanks in advance!

thanks alot! ended doing this:

@override protected void onfinishinflate () {     super.onfinishinflate();     childs = this.getchildcount(); } 

since used childs variable in activity, , there needed set value before hit activity-oncreate..which solved :)

thanks guidence!


Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -