如何为 Android 支持库启用 javadoc? [英] How can I enable javadoc for the Android support library?
问题描述
当为了兼容性而使用 Android 支持库并尝试查看 javadoc 时,例如 FragmentTransaction
,我收到以下错误,因为没有关联的 javadoc 文件:
When using the Android support library for compatibility and try to view the javadoc for, say, FragmentTransaction
, I get the following error because there is no associated javadoc file:
android.support.v4.app.FragmentTransaction
android.support.v4.app.FragmentTransaction
注意:这个元素既没有附加源也没有附加Javadoc因此找不到 Javadoc.
Note: This element neither has attached source nor attached Javadoc and hence no Javadoc could be found.
在项目属性中的Android Dependencies项下添加了支持库,并显示Javadoc位置:(无)-不可修改,如下所示.有什么解决方法吗?
The support library is added under the Android Dependencies item in the project properties, and shows Javadoc location: (None) - non-modifiable as shown below. Is there any workaround for this?
推荐答案
我已经将一个项目与 android-support-v4.jar 捆绑在包视图的 Android 依赖项部分.我有课
I've lashed together a project with android-support-v4.jar just in the Android Dependencies part of the package view. I have a class
public class CountriesFragment extends ListFragment {...}
和
import android.support.v4.app.ListFragment;
上面
我在 libs
文件夹中创建了一个文件 android-support-v4.jar.properties
.它包含以下行:
I created a file android-support-v4.jar.properties
in the libs
folder. It contains the lines:
doc=c:\[path-to-android-sdk]\docs\reference
src=C:\[path-to-android-sdk]\extras\android\support\v4\src
如果不使用 Windows,大概您必须更改为未转义的正斜杠.
Presumably you'll have to change to un-escaped forward slashes if not using Windows.
接下来右键单击项目,选择刷新,然后您将获得javadoc支持.您实际上并不需要 doc 条目——src 条目已经包含 javadocs.
Next right-click the project, select refresh, then you'll get javadoc support. You don't really need the doc entry--the src entry already contains the javadocs.
这篇关于如何为 Android 支持库启用 javadoc?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!