Friday, May 17, 2013

[android help] Counting the number of controls in Android

Counting the number of controls in Android - Stack Overflow







Tell me more ×

Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

















I'm new to android, right now I am trying to find a way to get the number of controls (I don't know how to call these in android, I mean like I have 4 textviews, 2 edittexts, 3 buttons so in total I have 9 "controls"), is there any way to count them?


Thanks in advanced.


























They're called Views in Android. Yes, even the buttons. Are you creating them in XML or programmatically? Is there a static number or are there ever going to be more or less? You can use getChildCount() but you'd have to do it recursively if you have views inside views.




















default






.

stackoverflow.comm

No comments:

Post a Comment

Google Voice on T-Mobile? [General]

Google Voice on T-Mobile? So I recently switched from a GNex on Verizon to a Moto X DE on T-Mobile. I had always used Google Voice for my v...