Go Back   Android Forums > Android Development > Application Development
Application Development Dev lounge for our application developers.

Get excited for the Samsung Galaxy S5! Find everything you need and discuss it in our Galaxy S5 Forum!

test: Reply
 
LinkBack Thread Tools
Old March 3rd, 2011, 10:31 PM   #1 (permalink)
New Member
Thread Author (OP)
 
Join Date: Feb 2011
Posts: 7
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 1 Time in 1 Post
Default 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

That Don Guy is offline  
Reply With Quote
sponsored links
Old March 4th, 2011, 03:32 AM   #2 (permalink)
Member
 
Join Date: Feb 2011
Location: Netherlands
Posts: 235
 
Device(s): Samsung Galaxy S
Carrier: Not Provided

Thanks: 8
Thanked 22 Times in 21 Posts
Default

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
pietjuhhh1990 is offline  
Reply With Quote
Old March 4th, 2011, 01:47 PM   #3 (permalink)
Member
 
Join Date: Dec 2010
Location: Aarhus, Denmark
Posts: 136
 
Device(s): SE Xperia X10
Carrier: Not Provided

Thanks: 2
Thanked 22 Times in 22 Posts
Default

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 :-)
JamTheMan is offline  
Reply With Quote
Reply


Go Back   Android Forums > Android Development > Application Development
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 10:48 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.