Use findViewById() for the top view, and then you can iterate through the children views as you want.
On Mon, Jul 13, 2009 at 9:57 AM, Mathieu Plourde <[email protected]>wrote: > > But is there a way to get my LinearLayout from my activity object? > > On Jul 13, 12:41 pm, Lutz Schönemann > <[email protected]> wrote: > > If you have all your Views in a LinearLayout or an other container > > that extends ViewGroup you can use the functions > > getChildCount() and getChildAt(int) and iterate through all of the > > contained views. > > > > Am 13.07.2009 um 18:21 schrieb Mathieu Plourde: > > > > > > > > > I have the instance to my activity, and I want to get all the views > > > that are in this activity. I need to add a listener to each view, for > > > any activity. That means I can't user findViewById. Is there any way > > > to do this? I was hoping for a activity.getViews() or something, but > > > it doesn't exist. > > > -- Dianne Hackborn Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

