Question: I have been coping with an annoying "bug" in eclipse (android) for some time, and today it has just annoyed me to much! So I was wondering has anyone else come accross it, and have you found a fix for it?

It's hard to explain, so hopefully these three screen caps will help:

The first screenshot, everything is ok.

![Screen 1 - Everything is ok](https://i.stack.imgur.com/bhq2w.png)

The second screenshot, after a simple click everything moves around.

![Screen 2 - A simple click, notice how lines have duplicated and moved](https://i.stack.imgur.com/Rc8cm.png)

The third screenshot, another click and things move again.

![Screen 3 - Another click, things move again](https://i.stack.imgur.com/4MS0Q.png)

Closing the file and opening it again seams to solve the problem for a while, but it's really annoying!

Has anyone come across this, or a fix for it?

--**EDIT**

Forgot to mention, I am running:

* Eclipse 4.2.0 64-Bit (on Windows 7)
* ADT 20

Answer: 
This is a known bug and happens if you edit the layout in the visual editor and then switch back to the xml editor. You can sometimes fix it by scrolling up and down the file or selecting all the text. Otherwise, just close and reopen the xml file when switching from visual editor to xml editor. It's annoying and still happens to me even after several updates to ADT.

**Edit:**

I have since found a better solution. In Eclipse go to Window->Preferences. Then under Android->Editors uncheck "Automatically format the XML edited by the visual layout editor". This should solve the problem. You can always auto-format the code manually by pressing `Ctrl`+`Shift`+`F`.
As some commentators have mentioned it seems that this is a duplicate (have flagged as such), although as it is a hard issue to describe that is no surprise! I have tried an [answer](https://stackoverflow.com/a/11418891/508401) from one of the questions and it seems to solve the problem. Although it does not prevent the issue!