Eclipse, two different files with the same name in different directories

it makes me a little crazy, but the android way puts everything, you have different directories with the same xml name.

for example, you might have:

res / layout / main.xml and
Res / layout earth /main.xml

When you are in landscape mode, he will know how to use the one that is in the layout directory.

It's actually annoying that when I am in Eclipse and I have a res / layout / main.xml file, and if in the project explorer I click to open it in layout-land / main.xml, it just leaves open (res / layout / main.xml) open. This is very annoying. You can get around it by simply closing the one that opens, and then when you click to open it in the layout, it will open the correct one, but not as long as you already have a file with this name (not the same directory) open.

Is there a way to fix this otherwise than using another editor or "living with it"?

+6
android eclipse
source share
2 answers

When I do as you describe, Eclipse opens a new layout and automatically closes another. It seems that the same file has remained open; however, the content changes, and if you hover over the editor tab, you can see in which folder the file is located. As a result, you can only have one version during a specific layout opened in the Android layout editor. This is probably a necessary limitation due to the internal components of the Android layout editor.

If you want to edit both files at the same time, you can open one or both using the XML editor (right-click> Open s> XML Editor).

+4
source share

This has been fixed in the latest release of Indigo Eclipse (Service Release 1), however it does not always open files in the mock ground folder using the Android layout editor. To do this, you can right-click on the file and select "Open With ..."> "Android Layout Editor."

0
source share

All Articles