I have one main.xml layout (top level is a LinearLayout) resource and
I inflate this in the usual way within Activity.onCreate():

setContentView(R.layout.main);

Now, I want to get a reference to the corresponding LinearLayout, but
how?

At the moment I have to add an id attribute to the LinearLayout
defined in the resouce file and then do this:

LinearLayout mainLayout = (LinearLayout)findViewById(R.id.mainLayout);

But I'm sure there must be an easier way?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" 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-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to