Loop through all subclasses in an Android view?
- by Slapout
I’m working on a game for Android. To help implement it, my idea is to create a subclass of a view. I would then insert several instances of this class as children of the main view. Each instance would handle detecting when it was pressed (via OnTouchListener).
The problem I’m having now is how do I loop through all these sub-views so I can read their statuses and process them? (I.e. when they all reach a certain state something should happen).
Or is there a better way to have several objects on the screen that respond to touch and whose status I can check?