Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make Ctrl+F11 launch Android project even when on XML file

Ctrl+F11 on Eclipse is a life saver. Unfortunately, it only works when the currently selected file tab is of a .java file. It doesn't work when the currently selected file tab is of an .xml file.

I searched this great SO resource and found something very similar to what I am looking for but unfortunately the solution offered simply doesn't work for XML in an Android project.

Is there a way to make Ctrl+F11 launch Android project even when on XML file?

This is my current preferences dialog windows:

enter image description here

Update: This mysteriously started working. I have no idea how this happened (I didn't change anything in the Eclipse, except for existing Eclipse and restarting it).

like image 786
ef2011 Avatar asked May 05 '11 15:05

ef2011


3 Answers

This fixed the problem for me.

Eclipse -> Window -> Preferences -> Run/Debug -> Launching -> Launch Operation -> Always Launch the previously launched application

like image 91
Rob Avatar answered Nov 09 '22 00:11

Rob


Answering myself (after about 4 months): There isn't a way to make Ctrl+F11 launch Android project even when on XML file.

A currently working workaround is to select a .java file (Ctrl+F6), then run the project's exec via Ctrl+F11.

Alternatively, if you need to see the LogCat while the program is running, inject a Ctrl+F8 in between, i.e.:

  1. Select a .java file (Ctrl+F6),
  2. Switch to DDMS perspective (Ctrl+F8)
  3. Run the project's exec via Ctrl+F11.

Anything to avoid lifting hand from the keyboard... ;)

like image 32
ef2011 Avatar answered Nov 08 '22 23:11

ef2011


An alternative shortcut: Alt + Shift + A, which pops up an Android specific menu. Then press R or select Run with the mouse.

like image 2
HRJ Avatar answered Nov 08 '22 22:11

HRJ