在Eclipse中开发Android项目时,鼠标停放在想要查看帮助文档的类上面,发现没有显示帮助文档,显示了下面一句话:

Note: This element neither has attached source nor attached Javadoc and hence no Javadoc could be found.

这是因为Android.jar文件的Javadoc location属性没有设置好,按照下面不走进行操作:

(1) 右击项目名称,选择Properties-->Java Build Path;

(2)找到android.jar文件,并展开,可以看见Javadoc location没有设置;

Note: This element neither has attached source nor attached Javadoc and hence no Javadoc could be found.-LMLPHP

(3)选中Javadoc location,点击右边的Edit按钮,选择Javadoc路径并确定,Javadoc路径一般为/sdk/docs/reference/(如我的机器上是file:/E:/HZHI/adt-bundle-windows-x86_64-20140702/sdk/docs/reference/);

Note: This element neither has attached source nor attached Javadoc and hence no Javadoc could be found.-LMLPHP

(4)可以看到,设置Javadoc location成功,再次确定。

Note: This element neither has attached source nor attached Javadoc and hence no Javadoc could be found.-LMLPHP

现在,鼠标停放在想要查看帮助文档的类上面,就会看见显示了帮助文档。

如果你的/sdk/docs/下面一片空白,没有东西,可以运行SDK Manager,在Documention for Android SDK前面打钩下载(下图中已经下载)。

Note: This element neither has attached source nor attached Javadoc and hence no Javadoc could be found.-LMLPHP

04-14 19:46