Issue
In Android Studio, if I reference a resource in code, for example R.string.some_sample_string or R.layout.activity_main, and I jump to definition (CMD + B on OS X) it will take me to the line in the appropriate strings.xml file or the appropriate layout xml file for activity_main.xml.
Lately I've been using IntelliJ IDEA Ultimate for Android development. When I jump to definition in IDEA it brings me to the declaration of the class in the generated R.class file instead of the resource XML files.
Is there a way to make IDEA behave like Android Studio and jump to the xml files instead of the java class declarations?
Solution
It turns out the issue here was actually my project file. On our team, we use our own project generation with our monorepo to automate selecting which files should be indexed by IntelliJ. As it turns out this is currently an issue/limitation with our internal automation tool.
It's not a spectacular answer, but if you are encountering a similar issue I would suspect that the project file has been tampered with and that you should either nuke it and create a new one or take it up with anyone who might be doing this similar kind of project manipulation in your team.
Answered By - grego
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.