In Eclipse, how can I quickly access the source of an “android library project” from the source of a project that uses it?

我的梦境 提交于 2019-12-04 23:09:48

问题


  • Project A is an android library project in my workspace(via project properties->android->library: is library).
  • Project A declares classA.
  • Project B uses project A (via project properties->android->library: add...).
  • Project B instantiates classA.

When I use F3 ("open declaration") over the classA instance in project B, it leads me to the classA.class in the A.jar that is included in B, built from A.

Is there a way to go directly to the source classA.java in project A rather than looking for it in the package explorer?

I think this is new to ADT14, formerly there were X_src folder for each included library project: e.g. A_src would appear in B as a source folder in the root of the project.


回答1:


Right click on the non-library project (Project B) and select Build Path:

  • In the Projects tab, add the library project Project A as a dependency.
  • In the Order and Exports tab, be sure Project A is given higher precedence than the placeholder/bundle Library Projects.

I had to do both of these steps in order to fix this issue, with ADT15, Eclipse 3.7 and new projects.



来源:https://stackoverflow.com/questions/7896855/in-eclipse-how-can-i-quickly-access-the-source-of-an-android-library-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!