5

I hate when I try to open the declaration of a layout and Eclipse redirects me to the R file, which is the same as nothing. Is there a keyboard shortcut for it to take me to the layout file. I know if you click on it with CTRL it gives you this option on a pop-up, but I hate using the mouse. I can't find this on the keybinding section. There's just plain "open declaration" which I have already changed because it was a horrible F3 by default, but this usually takes you to the R file

2 Answers 2

3

Well there is a mouse shortcut - Just hold down CTRL and hover over the id you want to see. You'll get two options, one for R.java and other to open the declaration. Choose the second one

EDIT:

Sorry, completely missed the part where you dont like the mouse use. Well I dont think there is any other way, and I see a bug/feature request here https://code.google.com/p/android/issues/detail?id=53536 reported specifically asking for this, so I wouldnt think another way exists other than either using the mouse or using the keyboard to highlight the particular item of interest and using Ctrl+Shift+R to get the menu and pressing Enter but like you mention this wouldnt work for something like R.id.foo . Wish someone from Google/Eclipse could comment on the bug/feature request.

Sign up to request clarification or add additional context in comments.

1 Comment

Damn, I hate those downer bug tracking pages. They're always telling me "tough luck"
0

If you CTRL + Shift + r : you can open any resource. Using this with any text selected will pre-populate the open resource dialog with the text you selected. After that you should be able to find the file you want very quickly and double click it to open (or use down arrow and enter for openting without using a mouse).

Hope this helps.

1 Comment

not really because CTRL+Shift+R will only look for resources like .java or .xml but not a field like R.id.foo . Highlighting foo and pressing CTRL+Shift+R will pre-populate the window but won't show any result

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.