Hi,

I need an advice of a good practice for the following situation.

I have defined my Relative Layout in an XML file. What I'd like to do
is to obtain a reference from that file in Java code, perform some I/O
operations, and based on the data I get to add a few views on to the
layout eventually.

At the moment I get a NullPointerException from my Activity when I do
the following:

RelativeLayout layout = (RelativeLayout) findViewById(R.layout.l1);
setContent(layout);

Is that a wrong way of obtaining a reference of my Layout?

Thanks!

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to