问题
I have two packages^ in Eclipse. One is marked as a Library and the other references it (under properties->Android), as described here: http://developer.android.com/guide/developing/projects/projects-eclipse.html
My problem is that when I hover the mouse over some code referring to the referenced project eclipse displays
"This element has no attached javadoc and the javadoc could not be found in the attached source"
Furthermore when I select "Open Declaration" in the context menu for said code, it opens the associated .class (instead of the .Java) with the messsage
"The JAR of this class file belongs to container 'Android Dependencies' which does not allow modifications to source attachments on entries"
^ root nodes in the Package Explorer, so I assume they're called packages and not projects. Neither of them are jars.
回答1:
this should have been fixed in latest adt version, but in case someone still have this problem like me, here's what i did:
I switched the order of src in .classpath file of my library projects, to this (note that the path="src" must be in the first line)
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
回答2:
If you right click on a jar file, you can go to the properties menu. In that there is javadoc location option on the side which allows u to specify the path. Might work for the library project too.
来源:https://stackoverflow.com/questions/10175624/how-do-i-see-source-or-javadocs-for-a-library-dependency-in-an-android-package-i