• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Eclipse Graphical Layout doesn't like Include?

I have an app where the main.xml file has an <include> tag. The app works as I expect, but whenever I try to show the main.xml's Graphical Layout tab in Eclipse, I get the error:

You must specifiy a valid layout reference. The layout ID @layout/the_include_file is not valid.
Couldn't resolve resource @layout/the_include_file

even though the_include_file.xml not only exists but is in /res/layout.

Is there a way around this, or is this just an Eclipse "feature"?
By the way, the version information (from the About box) is:
Version: Helios Service Release 1
Build id: 20100917-0705

-- Don
 
How/what is it you are includeing?

If you want to add a layout use

setContentView(R.layout.yourxml);

Do not use .xml behint the lookup onley the name of the file
 
Is the the_include_file.xml actually valid android XML? I mean does it have a usable View as root and stuff?
The include should work regardless, as long as the xml fits whereever you include it, but maybe Eclipse's GUI editor is too stricts... But as long as it works :-)
 
Back
Top Bottom