Original Title: What is the hotkey, if any, for navigating to layout file or a resource's value?
(This question didn't really describe the issue at hand. And as you can imagine, it attracted some obvious answers. My apologies, this is the first question I've posted.)
I'm using Android Studio version 1.1.0 on Mac.
Say I have a line of code similar to this:
setContentView(R.layout.layout_main);
In Eclipse, I could simply use 'command + click' on the resource ID and it would navigate to the respective xml file then highlight the string, view, or color declaration. However, doing so in Android Studio navigates me to the declaration within the R file, which is utterly useless.
Is there a separate hotkey that I missed, or a separate event/action I could bind the current hotkey to, that would cause AS to operate more like Eclipse in this manner?
EDIT
After a couple answers -- which were correct according to the original question -- and some experimentation (created a fresh new project - I feel silly for not doing that earlier), it seems Android Studio should in fact navigate to the exact line in the xml where the View, String, or Color resource is declared, just like Eclipse does. However in my situation, it isn't for some odd reason.
This is merely speculation, but I suppose the culprit could be one or a combination of three things:
Shift + Tab to decrease the indent.
Just press CTRL+O on Windows or Command+O on Mac and you'll be presented with a list of methods that you can override.
Automatically formatting code in Android Studio and IntelliJ To automatically format your code in the current source code window, use Cmd+Alt+L (on Mac) or Ctrl+Alt+L (on Windows and Linux).
To open the keymap settings, choose File > Settings (on Mac, Android Studio > Preferences) and navigate to the Keymap pane. Figure 1. The Android Studio keymap settings window. Keymaps dropdown: Select the desired keymap from this menu to switch between preset keymaps.
CTRL + B should do it. Otherwise you can create your own shortcuts.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With