Sunday, 15 August 2010

eclipse - Android Studio - Hotkey for navigating to xml declaration is instead navigating to R file -


Original title: What is hotkey, if any, to navigate to the layout file or value of the resource?

(This question really did not tell the issue in hand and as you can imagine, it attracted some clear answer. Ask for forgiveness, this is the first question I have posted. )

I am using Android Studio version 1.1.0 on the Mac.

Say I have a code like this:

  setContentView (R.layout layout_main); In Eclipse, I could just use ' command + click ' on the resource ID and navigate to the related XML file, then string, view, Or color declaration, however, doing so in Android studios is navigating to me in the R File, which is absolutely useless 

Do I have a different hotkey that I remember, or a different event / action, can I tie the existing hotkey, so that more work like eclipse will be done like this?

Edit

After a few replies - which were right according to the original question - and some experimentation (a new new project was created - I think To do this before stupidity), it seems that Android Studio should actually navigate to the exact line in XML where the view, string, or color resource is declared, like eclipse Although in my situation, it is a matter of some strange reason New is not.

It is only speculation, but I think that the culprit can be a combination of one or three things:

  1. The project I was working on - this recently Was migrated to an Android studio project from an Eclipse project. This is most likely because it continues to update issue 2 and 3.
  2. JDK version - When I created a new project, AS complained that my compiler was outdated (1.6 was running, which was upgraded to 1.7).
  3. Target SDK - The reason I was asked to upgrade to JDK.

CTRL + B should do this. Otherwise you can create your own shortcut.


No comments:

Post a Comment