Reputation: 128
When compiling android stuff in eclipse, I am forever annoyed when I hit the "Run" button to compile and run, if I am in a .java file everything works great if im in an .xml file (for android layouts) it compiles the xml file and produces an _out.xml file which screws up the project so that I first have to delete the "out" file then clean my project files.
Any quick answer on how to disable the compiling of xml files?
Upvotes: 8
Views: 2568
Reputation: 4387
There is no way to do this, the reason it happens is because of the fact that when you click "run" it's trying to run the .xml instead of the Project its-self. The easiest thing to do to avoid this, is when you go to hit run do a Ctrl+s, then click on the project folder, then hit run, or do the same thing, but switch tab to a .java file. Sorry to be the bearer or bad news, when I started I had the same problem.. drove me crazy, but when you get into the new habit, you're just fine!
Upvotes: 4
Reputation: 57682
Samuel has told already a solution. What I prefer is to use the "always run the last project" setting.
Go to window -> preferences -> Run/Debug -> Launching and than activate the option on the bottom labeled: "Always launch the previously launched application"
If you have multiple projects you will sometimes have the issue that you start a project you didn't meant to start. That will occur only once, because after starting the right project, you will stick to that until you switch to the next project (which shouldn't happen very often on a working day).
Its not a perfect solution, but prevents the mentioned issue with, in my experience, the lowest/smallest (whats the right term?) side effects.
Upvotes: 10