Search code examples
androideclipseandroid-layoutadt

Android XML editors broken in Eclipse


Until today (I have no idea what I did to cause this), if I double-clicked an android XML file, then the correct editor would appear.

For example, double-clicking a layout file would open a Graphical Layout tab and a tab with the XML contents for direct editing (named as the file being edited). Now all I get is a Design and a Source tab!

I am unable to preview the layouts I am editing (this is the same as here: Graphical Layout tab does not appear for some layout files into Eclipse)

That link also gives a 'workaround' in that I can right-click the file and open with the right editor, but this isn't a solution!

How can I sort this permenantly? I have re-installed fresh Eclipse, ADT to no avail (haven't used fresh SDK... will that matter??).

** Note this happens to all Android XML files, not just layout ones I mentioned above! **


Solution

  • Yes this may be a permanent solution:

    1. Select any XML layout file
    2. click on Window->Preferences menu.
    3. Follow steps as mentioned in attached image.

    enter image description here