Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android trying to run my project in eclipse and end up with xml.out

Sometimes when I am working on a projects layout in Eclipse I hit the run button while the active thing on the screen is still the layout.xml file. This causes eclipse to try to run just the xml file instead of the actual android project. I know that when I do this I can fix it by just deleting the xml.out file that gets created and clean/build on my project. However I remember using Eclipse at some point in the past when it didn't do this, if I hit run while working with an xml it still ran the Android project, just as if I had clicked run while editing a java file. My question is does anyone know if there is some sort of setting I can modify that will change the behavior back to that so that I don't have to switch back and forth to a java file just to run while I am actually doing work on the layout.

Edit: That works but now I can't launch any other applications that I am working on without resetting that preference. Is there perhaps a way to make it treat xml files as though they are 'not launchable' so that it will go down to option that I select for what to do if active resource is not launchable? Because the "Launch the associated project" option thats under that seems like exactly what I want it to do when I try to launch an xml file.

like image 753
FoamyGuy Avatar asked Mar 18 '11 13:03

FoamyGuy


3 Answers

Under Preferences -> Run/Debug -> Launching, you can select "Always launch the previously launched application", so run the proper file once with this option marked and it will keep running the proper file for the rest of your life :)

like image 75
dLobatog Avatar answered Nov 15 '22 21:11

dLobatog


Window -> Preferences -> Run/Debug -> Launching

On this page, under "Launch Operation", check the box next to "Always launch the previously launched application"

like image 27
Codemonkey Avatar answered Nov 15 '22 19:11

Codemonkey


you can just select the project in the package explorer before performing a launch this way you do not end up with the xml launch configuration but with the project launch configuration where you can launch it as an android app.

This way you can keep the content of your editor

like image 25
senola Avatar answered Nov 15 '22 21:11

senola