OK I found out that the NullPointer exception is caused by this line RelativeLayout layout2 = (RelativeLayout) findViewById(R.id.page1layout);
I guess this is because I haven't done a setContentView on page1.xml. But I don't want to do this. I want to basically grab the UI layout described in page1.xml and stick it into main.xml's relativelayout. Is this possible? The reason I want to do this is so that I can have multiple views defined in seperate XML files. If this is not possible can I describe the multiple views in one xml file and somehow programmatically show them. On May 14, 4:08 pm, rukiman <[EMAIL PROTECTED]> wrote: > Perphaps this might help I have > > main.xml <--- main view > page1.xml <-- the xml I pasted above. > > So basically I want to set a RelativeLayout widget in main.xml with > the components which I defined in page1.xml > > On May 14, 4:06 pm, rukiman <[EMAIL PROTECTED]> wrote: > > > > > Perphaps this might help I have > > > main.xml <--- main view > > page1.xml <-- the xml I pasted above. > > > So basically I want to set a RelativeLayout widget in main.xml with > > the components which I defined in page1.xml- Hide quoted text - > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ 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] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

