Eclipse下加载AndroidSDK源码

在Eclipse下开发Android程序时,智能提示会出现:

Note: The Javadoc for this element could neither be found in the attached source nor the attached Javadoc

是由于AndroidSDK中不包含源码.

下载源码(http://rgruet.free.fr/public/)后.

将源码解压到相应版本的sources目录下.注意sources必须为这个名字.

在Eclipse菜单中Windows-->Preference,打开如下节点

image

1>点New按钮...输入名字,如采用的SDK是2.1版本.可录入Android2.1。此名称并不限定.

2>点Add JARs...按钮 选择相应版本SDK的jar文件.

3>然后打开刚才创建的树形节点,选择Source Attachment 点Edit...按钮

image

此处路径就是刚才解压源码的那个目录.注意必须为文件夹名sources...(我也搞不明白为什么,比如使用source文件夹名称,就不能提示).

点击OK,重启Eclipse...一切搞定.

image

原文地址:https://www.cnblogs.com/yaoshi641/p/1872179.html